diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/pom.xml b/sdk/recoveryservices.backup/mgmt-v2020_02_02/pom.xml new file mode 100644 index 0000000000000..d5e1c550b8e80 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/pom.xml @@ -0,0 +1,137 @@ + + + 4.0.0 + com.microsoft.azure.recoveryservices.backup.v2020_02_02 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.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-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupGoalFeatureSupportRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupGoalFeatureSupportRequest.java new file mode 100644 index 0000000000000..ac0ad190ed0df --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupGoalFeatureSupportRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure backup goal feature specific request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "featureType", defaultImpl = AzureBackupGoalFeatureSupportRequest.class) +@JsonTypeName("AzureBackupGoals") +public class AzureBackupGoalFeatureSupportRequest extends FeatureSupportRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupServerContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupServerContainer.java new file mode 100644 index 0000000000000..745f4d5362d00 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupServerContainer.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureBackupServer (DPMVenus) workload-specific protection container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureBackupServerContainer.class) +@JsonTypeName("AzureBackupServerContainer") +public class AzureBackupServerContainer extends DpmContainer { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupServerEngine.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupServerEngine.java new file mode 100644 index 0000000000000..ba1ef81e683cc --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureBackupServerEngine.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Backup engine type when Azure Backup Server is used to manage the backups. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType", defaultImpl = AzureBackupServerEngine.class) +@JsonTypeName("AzureBackupServerEngine") +public class AzureBackupServerEngine extends BackupEngineBase { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareBackupRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareBackupRequest.java new file mode 100644 index 0000000000000..ef0e52cd16243 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareBackupRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureFileShare workload-specific backup request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureFileShareBackupRequest.class) +@JsonTypeName("AzureFileShareBackupRequest") +public class AzureFileShareBackupRequest extends BackupRequest { + /** + * Backup copy will expire after the time specified (UTC). + */ + @JsonProperty(value = "recoveryPointExpiryTimeInUTC") + private DateTime recoveryPointExpiryTimeInUTC; + + /** + * Get backup copy will expire after the time specified (UTC). + * + * @return the recoveryPointExpiryTimeInUTC value + */ + public DateTime recoveryPointExpiryTimeInUTC() { + return this.recoveryPointExpiryTimeInUTC; + } + + /** + * Set backup copy will expire after the time specified (UTC). + * + * @param recoveryPointExpiryTimeInUTC the recoveryPointExpiryTimeInUTC value to set + * @return the AzureFileShareBackupRequest object itself. + */ + public AzureFileShareBackupRequest withRecoveryPointExpiryTimeInUTC(DateTime recoveryPointExpiryTimeInUTC) { + this.recoveryPointExpiryTimeInUTC = recoveryPointExpiryTimeInUTC; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProtectableItem.java new file mode 100644 index 0000000000000..1a479e726e673 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProtectableItem.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Protectable item for Azure Fileshare workloads. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureFileShareProtectableItem.class) +@JsonTypeName("AzureFileShare") +public class AzureFileShareProtectableItem extends WorkloadProtectableItem { + /** + * Full Fabric ID of container to which this protectable item belongs. For + * example, ARM ID. + */ + @JsonProperty(value = "parentContainerFabricId") + private String parentContainerFabricId; + + /** + * Friendly name of container to which this protectable item belongs. + */ + @JsonProperty(value = "parentContainerFriendlyName") + private String parentContainerFriendlyName; + + /** + * File Share type XSync or XSMB. Possible values include: 'Invalid', + * 'XSMB', 'XSync'. + */ + @JsonProperty(value = "azureFileShareType") + private AzureFileShareType azureFileShareType; + + /** + * Get full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + * + * @return the parentContainerFabricId value + */ + public String parentContainerFabricId() { + return this.parentContainerFabricId; + } + + /** + * Set full Fabric ID of container to which this protectable item belongs. For example, ARM ID. + * + * @param parentContainerFabricId the parentContainerFabricId value to set + * @return the AzureFileShareProtectableItem object itself. + */ + public AzureFileShareProtectableItem withParentContainerFabricId(String parentContainerFabricId) { + this.parentContainerFabricId = parentContainerFabricId; + return this; + } + + /** + * Get friendly name of container to which this protectable item belongs. + * + * @return the parentContainerFriendlyName value + */ + public String parentContainerFriendlyName() { + return this.parentContainerFriendlyName; + } + + /** + * Set friendly name of container to which this protectable item belongs. + * + * @param parentContainerFriendlyName the parentContainerFriendlyName value to set + * @return the AzureFileShareProtectableItem object itself. + */ + public AzureFileShareProtectableItem withParentContainerFriendlyName(String parentContainerFriendlyName) { + this.parentContainerFriendlyName = parentContainerFriendlyName; + return this; + } + + /** + * Get file Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync'. + * + * @return the azureFileShareType value + */ + public AzureFileShareType azureFileShareType() { + return this.azureFileShareType; + } + + /** + * Set file Share type XSync or XSMB. Possible values include: 'Invalid', 'XSMB', 'XSync'. + * + * @param azureFileShareType the azureFileShareType value to set + * @return the AzureFileShareProtectableItem object itself. + */ + public AzureFileShareProtectableItem withAzureFileShareType(AzureFileShareType azureFileShareType) { + this.azureFileShareType = azureFileShareType; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProtectionPolicy.java new file mode 100644 index 0000000000000..a8399f66940bd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProtectionPolicy.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureStorage backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType", defaultImpl = AzureFileShareProtectionPolicy.class) +@JsonTypeName("AzureStorage") +public class AzureFileShareProtectionPolicy extends ProtectionPolicy { + /** + * Type of workload for the backup management. Possible values include: + * 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + * 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + * 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workLoadType") + private WorkloadType workLoadType; + + /** + * Backup schedule specified as part of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /** + * Retention policy with the details on backup copy retention ranges. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * Get type of workload for the backup management. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workLoadType value + */ + public WorkloadType workLoadType() { + return this.workLoadType; + } + + /** + * Set type of workload for the backup management. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workLoadType the workLoadType value to set + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withWorkLoadType(WorkloadType workLoadType) { + this.workLoadType = workLoadType; + return this; + } + + /** + * Get backup schedule specified as part of backup policy. + * + * @return the schedulePolicy value + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set backup schedule specified as part of backup policy. + * + * @param schedulePolicy the schedulePolicy value to set + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get retention policy with the details on backup copy retention ranges. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set retention policy with the details on backup copy retention ranges. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set + * @return the AzureFileShareProtectionPolicy object itself. + */ + public AzureFileShareProtectionPolicy withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProvisionILRRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProvisionILRRequest.java new file mode 100644 index 0000000000000..149c1eeaa3621 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareProvisionILRRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Update snapshot Uri with the correct friendly Name of the source Azure file + * share. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureFileShareProvisionILRRequest.class) +@JsonTypeName("AzureFileShareProvisionILRRequest") +public class AzureFileShareProvisionILRRequest extends ILRRequest { + /** + * Recovery point ID. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** + * Source Storage account ARM Id. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * Get recovery point ID. + * + * @return the recoveryPointId value + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set recovery point ID. + * + * @param recoveryPointId the recoveryPointId value to set + * @return the AzureFileShareProvisionILRRequest object itself. + */ + public AzureFileShareProvisionILRRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get source Storage account ARM Id. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set source Storage account ARM Id. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the AzureFileShareProvisionILRRequest object itself. + */ + public AzureFileShareProvisionILRRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareRecoveryPoint.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareRecoveryPoint.java new file mode 100644 index 0000000000000..78ba609de4bed --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareRecoveryPoint.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure File Share workload specific backup copy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureFileShareRecoveryPoint.class) +@JsonTypeName("AzureFileShareRecoveryPoint") +public class AzureFileShareRecoveryPoint extends RecoveryPoint { + /** + * Type of the backup copy. Specifies whether it is a crash consistent + * backup or app consistent. + */ + @JsonProperty(value = "recoveryPointType", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryPointType; + + /** + * Time at which this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime recoveryPointTime; + + /** + * Contains Url to the snapshot of fileshare, if applicable. + */ + @JsonProperty(value = "fileShareSnapshotUri", access = JsonProperty.Access.WRITE_ONLY) + private String fileShareSnapshotUri; + + /** + * Contains recovery point size. + */ + @JsonProperty(value = "recoveryPointSizeInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer recoveryPointSizeInGB; + + /** + * Get type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. + * + * @return the recoveryPointType value + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Get time at which this backup copy was created. + * + * @return the recoveryPointTime value + */ + public DateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get contains Url to the snapshot of fileshare, if applicable. + * + * @return the fileShareSnapshotUri value + */ + public String fileShareSnapshotUri() { + return this.fileShareSnapshotUri; + } + + /** + * Get contains recovery point size. + * + * @return the recoveryPointSizeInGB value + */ + public Integer recoveryPointSizeInGB() { + return this.recoveryPointSizeInGB; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareRestoreRequest.java new file mode 100644 index 0000000000000..36980f81eeaff --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareRestoreRequest.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureFileShare Restore Request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureFileShareRestoreRequest.class) +@JsonTypeName("AzureFileShareRestoreRequest") +public class AzureFileShareRestoreRequest extends RestoreRequest { + /** + * Type of this recovery. Possible values include: 'Invalid', + * 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + */ + @JsonProperty(value = "recoveryType") + private RecoveryType recoveryType; + + /** + * Source storage account ARM Id. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * Options to resolve copy conflicts. Possible values include: 'Invalid', + * 'CreateCopy', 'Skip', 'Overwrite', 'FailOnConflict'. + */ + @JsonProperty(value = "copyOptions") + private CopyOptions copyOptions; + + /** + * Restore Type (FullShareRestore or ItemLevelRestore). Possible values + * include: 'Invalid', 'FullShareRestore', 'ItemLevelRestore'. + */ + @JsonProperty(value = "restoreRequestType") + private RestoreRequestType restoreRequestType; + + /** + * List of Source Files/Folders(which need to recover) and TargetFolderPath + * details. + */ + @JsonProperty(value = "restoreFileSpecs") + private List restoreFileSpecs; + + /** + * Target File Share Details. + */ + @JsonProperty(value = "targetDetails") + private TargetAFSRestoreInfo targetDetails; + + /** + * Get type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + * + * @return the recoveryType value + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + * + * @param recoveryType the recoveryType value to set + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get source storage account ARM Id. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set source storage account ARM Id. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get options to resolve copy conflicts. Possible values include: 'Invalid', 'CreateCopy', 'Skip', 'Overwrite', 'FailOnConflict'. + * + * @return the copyOptions value + */ + public CopyOptions copyOptions() { + return this.copyOptions; + } + + /** + * Set options to resolve copy conflicts. Possible values include: 'Invalid', 'CreateCopy', 'Skip', 'Overwrite', 'FailOnConflict'. + * + * @param copyOptions the copyOptions value to set + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withCopyOptions(CopyOptions copyOptions) { + this.copyOptions = copyOptions; + return this; + } + + /** + * Get restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'Invalid', 'FullShareRestore', 'ItemLevelRestore'. + * + * @return the restoreRequestType value + */ + public RestoreRequestType restoreRequestType() { + return this.restoreRequestType; + } + + /** + * Set restore Type (FullShareRestore or ItemLevelRestore). Possible values include: 'Invalid', 'FullShareRestore', 'ItemLevelRestore'. + * + * @param restoreRequestType the restoreRequestType value to set + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRestoreRequestType(RestoreRequestType restoreRequestType) { + this.restoreRequestType = restoreRequestType; + return this; + } + + /** + * Get list of Source Files/Folders(which need to recover) and TargetFolderPath details. + * + * @return the restoreFileSpecs value + */ + public List restoreFileSpecs() { + return this.restoreFileSpecs; + } + + /** + * Set list of Source Files/Folders(which need to recover) and TargetFolderPath details. + * + * @param restoreFileSpecs the restoreFileSpecs value to set + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withRestoreFileSpecs(List restoreFileSpecs) { + this.restoreFileSpecs = restoreFileSpecs; + return this; + } + + /** + * Get target File Share Details. + * + * @return the targetDetails value + */ + public TargetAFSRestoreInfo targetDetails() { + return this.targetDetails; + } + + /** + * Set target File Share Details. + * + * @param targetDetails the targetDetails value to set + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withTargetDetails(TargetAFSRestoreInfo targetDetails) { + this.targetDetails = targetDetails; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareType.java new file mode 100644 index 0000000000000..7b1d4bc12ef58 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileShareType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureFileShareType. + */ +public final class AzureFileShareType extends ExpandableStringEnum { + /** Static value Invalid for AzureFileShareType. */ + public static final AzureFileShareType INVALID = fromString("Invalid"); + + /** Static value XSMB for AzureFileShareType. */ + public static final AzureFileShareType XSMB = fromString("XSMB"); + + /** Static value XSync for AzureFileShareType. */ + public static final AzureFileShareType XSYNC = fromString("XSync"); + + /** + * Creates or finds a AzureFileShareType from its string representation. + * @param name a name to look for + * @return the corresponding AzureFileShareType + */ + @JsonCreator + public static AzureFileShareType fromString(String name) { + return fromString(name, AzureFileShareType.class); + } + + /** + * @return known AzureFileShareType values + */ + public static Collection values() { + return values(AzureFileShareType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileshareProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileshareProtectedItem.java new file mode 100644 index 0000000000000..c4e2641898b40 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileshareProtectedItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure File Share workload-specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureFileshareProtectedItem.class) +@JsonTypeName("AzureFileShareProtectedItem") +public class AzureFileshareProtectedItem extends ProtectedItem { + /** + * Friendly name of the fileshare represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /** + * Backup state of this backup item. Possible values include: 'Invalid', + * 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', + * 'ProtectionPaused'. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /** + * Last backup operation status. Possible values: Healthy, Unhealthy. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private DateTime lastBackupTime; + + /** + * Health details of different KPIs. + */ + @JsonProperty(value = "kpisHealths") + private Map kpisHealths; + + /** + * Additional information with this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureFileshareProtectedItemExtendedInfo extendedInfo; + + /** + * Get friendly name of the fileshare represented by this backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the fileshare represented by this backup item. + * + * @param friendlyName the friendlyName value to set + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get backup status of this backup item. + * + * @return the protectionStatus value + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set backup status of this backup item. + * + * @param protectionStatus the protectionStatus value to set + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get 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 backup state of this backup item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @param protectionState the protectionState value to set + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get last backup operation status. Possible values: Healthy, Unhealthy. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set last backup operation status. Possible values: Healthy, Unhealthy. + * + * @param lastBackupStatus the lastBackupStatus value to set + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value + */ + public DateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withLastBackupTime(DateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get health details of different KPIs. + * + * @return the kpisHealths value + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** + * Get additional information with this backup item. + * + * @return the extendedInfo value + */ + public AzureFileshareProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information with this backup item. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureFileshareProtectedItem object itself. + */ + public AzureFileshareProtectedItem withExtendedInfo(AzureFileshareProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileshareProtectedItemExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileshareProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..78f8518a0f0f7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureFileshareProtectedItemExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information about Azure File Share backup item. + */ +public class AzureFileshareProtectedItemExtendedInfo { + /** + * The oldest backup copy available for this item in the service. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * Number of available backup copies associated with this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Indicates consistency of policy object and policy applied to this backup + * item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /** + * Indicates the state of this resource. Possible values are from enum + * ResourceState {Invalid, Active, SoftDeleted, Deleted}. + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private String resourceState; + + /** + * The resource state sync time for this backup item. + */ + @JsonProperty(value = "resourceStateSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime resourceStateSyncTime; + + /** + * 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 AzureFileshareProtectedItemExtendedInfo object itself. + */ + public AzureFileshareProtectedItemExtendedInfo withOldestRecoveryPoint(DateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get number of available backup copies associated with this backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set number of available backup copies associated with this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set + * @return the AzureFileshareProtectedItemExtendedInfo object itself. + */ + public AzureFileshareProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value + */ + public String policyState() { + return this.policyState; + } + + /** + * Set indicates consistency of policy object and policy applied to this backup item. + * + * @param policyState the policyState value to set + * @return the AzureFileshareProtectedItemExtendedInfo object itself. + */ + public AzureFileshareProtectedItemExtendedInfo withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + + /** + * Get indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, Deleted}. + * + * @return the resourceState value + */ + public String resourceState() { + return this.resourceState; + } + + /** + * Get the resource state sync time for this backup item. + * + * @return the resourceStateSyncTime value + */ + public DateTime resourceStateSyncTime() { + return this.resourceStateSyncTime; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSClassicComputeVMContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSClassicComputeVMContainer.java new file mode 100644 index 0000000000000..64d232ef8ff3a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing a classic virtual + * machine. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureIaaSClassicComputeVMContainer.class) +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +public class AzureIaaSClassicComputeVMContainer extends IaaSVMContainer { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSClassicComputeVMProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSClassicComputeVMProtectableItem.java new file mode 100644 index 0000000000000..d991fd466401f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing the Classic Compute VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureIaaSClassicComputeVMProtectableItem.class) +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +public class AzureIaaSClassicComputeVMProtectableItem extends IaaSVMProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSClassicComputeVMProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSClassicComputeVMProtectedItem.java new file mode 100644 index 0000000000000..df241cf021123 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing the Classic Compute VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureIaaSClassicComputeVMProtectedItem.class) +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +public class AzureIaaSClassicComputeVMProtectedItem extends AzureIaaSVMProtectedItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMContainer.java new file mode 100644 index 0000000000000..53c5f0e2544b8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing an Azure Resource Manager + * virtual machine. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureIaaSComputeVMContainer.class) +@JsonTypeName("Microsoft.Compute/virtualMachines") +public class AzureIaaSComputeVMContainer extends IaaSVMContainer { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMProtectableItem.java new file mode 100644 index 0000000000000..e584aae4dbcb3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMProtectableItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing the Azure Resource + * Manager VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureIaaSComputeVMProtectableItem.class) +@JsonTypeName("Microsoft.Compute/virtualMachines") +public class AzureIaaSComputeVMProtectableItem extends IaaSVMProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMProtectedItem.java new file mode 100644 index 0000000000000..4f5ff756975ae --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSComputeVMProtectedItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing the Azure Resource + * Manager VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureIaaSComputeVMProtectedItem.class) +@JsonTypeName("Microsoft.Compute/virtualMachines") +public class AzureIaaSComputeVMProtectedItem extends AzureIaaSVMProtectedItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMErrorInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMErrorInfo.java new file mode 100644 index 0000000000000..9c90891dd5628 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMErrorInfo.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /** + * Title: Typically, the entity that the error pertains to. + */ + @JsonProperty(value = "errorTitle", access = JsonProperty.Access.WRITE_ONLY) + private String errorTitle; + + /** + * Localized error string. + */ + @JsonProperty(value = "errorString", access = JsonProperty.Access.WRITE_ONLY) + private String errorString; + + /** + * List of localized recommendations for above error code. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get error code. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get title: Typically, the entity that the error pertains to. + * + * @return the errorTitle value + */ + public String errorTitle() { + return this.errorTitle; + } + + /** + * Get localized error string. + * + * @return the errorString value + */ + public String errorString() { + return this.errorString; + } + + /** + * Get list of localized recommendations for above error code. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMHealthDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMHealthDetails.java new file mode 100644 index 0000000000000..3130cb70c3c94 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMHealthDetails.java @@ -0,0 +1,18 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + + +/** + * Azure IaaS VM workload-specific Health Details. + */ +public class AzureIaaSVMHealthDetails extends ResourceHealthDetails { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJob.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJob.java new file mode 100644 index 0000000000000..10e1e28c336c3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJob.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.JobInner; + +/** + * Azure IaaS VM workload-specific job object. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType", defaultImpl = AzureIaaSVMJob.class) +@JsonTypeName("AzureIaaSVMJob") +public class AzureIaaSVMJob extends JobInner { + /** + * Time elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /** + * Error details on execution of this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Specifies whether the backup item is a Classic or an Azure Resource + * Manager VM. + */ + @JsonProperty(value = "virtualMachineVersion") + private String virtualMachineVersion; + + /** + * Additional information for this job. + */ + @JsonProperty(value = "extendedInfo") + private AzureIaaSVMJobExtendedInfo extendedInfo; + + /** + * Get time elapsed during the execution of this job. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set time 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/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set gets or sets the state/actions applicable on this job like cancel/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 on execution of this job. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set error details on execution of 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 or an Azure Resource Manager VM. + * + * @return the virtualMachineVersion value + */ + public String virtualMachineVersion() { + return this.virtualMachineVersion; + } + + /** + * Set specifies whether the backup item is a Classic or an Azure 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJobExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJobExtendedInfo.java new file mode 100644 index 0000000000000..2528cbbb97360 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJobExtendedInfo.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure IaaS VM workload-specific additional information for 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; + + /** + * Job internal properties. + */ + @JsonProperty(value = "internalPropertyBag") + private Map internalPropertyBag; + + /** + * Indicates progress of the job. Null if it has not started or completed. + */ + @JsonProperty(value = "progressPercentage") + private Double progressPercentage; + + /** + * Time remaining for execution of this job. + */ + @JsonProperty(value = "estimatedRemainingDuration") + private String estimatedRemainingDuration; + + /** + * 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 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 job internal properties. + * + * @return the internalPropertyBag value + */ + public Map internalPropertyBag() { + return this.internalPropertyBag; + } + + /** + * Set job internal properties. + * + * @param internalPropertyBag the internalPropertyBag value to set + * @return the AzureIaaSVMJobExtendedInfo object itself. + */ + public AzureIaaSVMJobExtendedInfo withInternalPropertyBag(Map internalPropertyBag) { + this.internalPropertyBag = internalPropertyBag; + 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 time remaining for execution of this job. + * + * @return the estimatedRemainingDuration value + */ + public String estimatedRemainingDuration() { + return this.estimatedRemainingDuration; + } + + /** + * Set time remaining for execution of this job. + * + * @param estimatedRemainingDuration the estimatedRemainingDuration value to set + * @return the AzureIaaSVMJobExtendedInfo object itself. + */ + public AzureIaaSVMJobExtendedInfo withEstimatedRemainingDuration(String estimatedRemainingDuration) { + this.estimatedRemainingDuration = estimatedRemainingDuration; + 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 AzureIaaSVMJobExtendedInfo object itself. + */ + public AzureIaaSVMJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJobTaskDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJobTaskDetails.java new file mode 100644 index 0000000000000..05e74ba95329a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMJobTaskDetails.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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 instanceId. + */ + @JsonProperty(value = "instanceId") + private String instanceId; + + /** + * Time elapsed for task. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Progress of the task. + */ + @JsonProperty(value = "progressPercentage") + private Double progressPercentage; + + /** + * Details about execution of the task. + * eg: number of bytes transferred etc. + */ + @JsonProperty(value = "taskExecutionDetails") + private String taskExecutionDetails; + + /** + * 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 instanceId. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId. + * + * @param instanceId the instanceId value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withInstanceId(String instanceId) { + this.instanceId = instanceId; + 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 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 progress of the task. + * + * @return the progressPercentage value + */ + public Double progressPercentage() { + return this.progressPercentage; + } + + /** + * Set progress of the task. + * + * @param progressPercentage the progressPercentage value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withProgressPercentage(Double progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Get details about execution of the task. + eg: number of bytes transferred etc. + * + * @return the taskExecutionDetails value + */ + public String taskExecutionDetails() { + return this.taskExecutionDetails; + } + + /** + * Set details about execution of the task. + eg: number of bytes transferred etc. + * + * @param taskExecutionDetails the taskExecutionDetails value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withTaskExecutionDetails(String taskExecutionDetails) { + this.taskExecutionDetails = taskExecutionDetails; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectedItem.java new file mode 100644 index 0000000000000..215b4d0f0001f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectedItem.java @@ -0,0 +1,346 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import java.util.Map; +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; + +/** + * IaaS VM workload-specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureIaaSVMProtectedItem.class) +@JsonTypeName("AzureIaaSVMProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Microsoft.ClassicCompute/virtualMachines", value = AzureIaaSClassicComputeVMProtectedItem.class), + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMProtectedItem.class) +}) +public class AzureIaaSVMProtectedItem extends ProtectedItem { + /** + * Friendly name of the VM represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Fully qualified ARM ID of the virtual machine represented by this item. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * Backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /** + * Backup state of this backup item. Possible values include: 'Invalid', + * 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', + * 'ProtectionPaused'. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /** + * Health status of protected item. Possible values include: 'Passed', + * 'ActionRequired', 'ActionSuggested', 'Invalid'. + */ + @JsonProperty(value = "healthStatus") + private HealthStatus healthStatus; + + /** + * Health details on this backup item. + */ + @JsonProperty(value = "healthDetails") + private List healthDetails; + + /** + * Health details of different KPIs. + */ + @JsonProperty(value = "kpisHealths") + private Map kpisHealths; + + /** + * Last backup operation status. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private DateTime lastBackupTime; + + /** + * Data ID of the protected item. + */ + @JsonProperty(value = "protectedItemDataId") + private String protectedItemDataId; + + /** + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureIaaSVMProtectedItemExtendedInfo extendedInfo; + + /** + * The extendedProperties property. + */ + @JsonProperty(value = "extendedProperties") + private ExtendedProperties extendedProperties; + + /** + * Get friendly name of the VM represented by this backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set 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 fully qualified ARM ID of the virtual machine represented by this item. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set fully qualified ARM 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 backup status of this backup item. + * + * @return the protectionStatus value + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set 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 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 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 health status of protected item. Possible values include: 'Passed', 'ActionRequired', 'ActionSuggested', 'Invalid'. + * + * @return the healthStatus value + */ + public HealthStatus healthStatus() { + return this.healthStatus; + } + + /** + * Set health status of protected item. Possible values include: 'Passed', 'ActionRequired', 'ActionSuggested', 'Invalid'. + * + * @param healthStatus the healthStatus value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withHealthStatus(HealthStatus healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get health details on this backup item. + * + * @return the healthDetails value + */ + public List healthDetails() { + return this.healthDetails; + } + + /** + * Set health details on this backup item. + * + * @param healthDetails the healthDetails value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withHealthDetails(List healthDetails) { + this.healthDetails = healthDetails; + return this; + } + + /** + * Get health details of different KPIs. + * + * @return the kpisHealths value + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + + /** + * Get last backup operation status. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set last backup operation status. + * + * @param lastBackupStatus the lastBackupStatus value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value + */ + public DateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set timestamp of the last backup operation on 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 data ID of the protected item. + * + * @return the protectedItemDataId value + */ + public String protectedItemDataId() { + return this.protectedItemDataId; + } + + /** + * Set data ID of the protected item. + * + * @param protectedItemDataId the protectedItemDataId value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withProtectedItemDataId(String protectedItemDataId) { + this.protectedItemDataId = protectedItemDataId; + 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; + } + + /** + * Get the extendedProperties value. + * + * @return the extendedProperties value + */ + public ExtendedProperties extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties value. + * + * @param extendedProperties the extendedProperties value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectedItemExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..ec85d45a774f1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectedItemExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information on Azure IaaS VM specific backup item. + */ +public class AzureIaaSVMProtectedItemExtendedInfo { + /** + * The oldest backup copy available for this backup item. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * Number of backup copies available for this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Specifies if 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 number of backup copies available for this backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set 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 backup policy associated with the backup item is inconsistent. + * + * @return the policyInconsistent value + */ + public Boolean policyInconsistent() { + return this.policyInconsistent; + } + + /** + * Set specifies if 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectionPolicy.java new file mode 100644 index 0000000000000..6319393e5ad52 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureIaaSVMProtectionPolicy.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType", defaultImpl = AzureIaaSVMProtectionPolicy.class) +@JsonTypeName("AzureIaasVM") +public class AzureIaaSVMProtectionPolicy extends ProtectionPolicy { + /** + * The instantRPDetails property. + */ + @JsonProperty(value = "instantRPDetails") + private InstantRPAdditionalDetails instantRPDetails; + + /** + * Backup schedule specified as part of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /** + * Retention policy with the details on backup copy retention ranges. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Instant RP retention policy range in days. + */ + @JsonProperty(value = "instantRpRetentionRangeInDays") + private Integer instantRpRetentionRangeInDays; + + /** + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * Get the instantRPDetails value. + * + * @return the instantRPDetails value + */ + public InstantRPAdditionalDetails instantRPDetails() { + return this.instantRPDetails; + } + + /** + * Set the instantRPDetails value. + * + * @param instantRPDetails the instantRPDetails value to set + * @return the AzureIaaSVMProtectionPolicy object itself. + */ + public AzureIaaSVMProtectionPolicy withInstantRPDetails(InstantRPAdditionalDetails instantRPDetails) { + this.instantRPDetails = instantRPDetails; + return this; + } + + /** + * Get backup schedule specified as part of backup policy. + * + * @return the schedulePolicy value + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set 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 retention policy with the details on backup copy retention ranges. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set 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; + } + + /** + * Get instant RP retention policy range in days. + * + * @return the instantRpRetentionRangeInDays value + */ + public Integer instantRpRetentionRangeInDays() { + return this.instantRpRetentionRangeInDays; + } + + /** + * Set instant RP retention policy range in days. + * + * @param instantRpRetentionRangeInDays the instantRpRetentionRangeInDays value to set + * @return the AzureIaaSVMProtectionPolicy object itself. + */ + public AzureIaaSVMProtectionPolicy withInstantRpRetentionRangeInDays(Integer instantRpRetentionRangeInDays) { + this.instantRpRetentionRangeInDays = instantRpRetentionRangeInDays; + return this; + } + + /** + * Get timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set + * @return the AzureIaaSVMProtectionPolicy object itself. + */ + public AzureIaaSVMProtectionPolicy withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureRecoveryServiceVaultProtectionIntent.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureRecoveryServiceVaultProtectionIntent.java new file mode 100644 index 0000000000000..75b17686a0ba3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureRecoveryServiceVaultProtectionIntent.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.ProtectionIntentInner; + +/** + * Azure Recovery Services Vault specific protection intent item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType", defaultImpl = AzureRecoveryServiceVaultProtectionIntent.class) +@JsonTypeName("RecoveryServiceVaultItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureWorkloadAutoProtectionIntent", value = AzureWorkloadAutoProtectionIntent.class) +}) +public class AzureRecoveryServiceVaultProtectionIntent extends ProtectionIntentInner { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureResourceProtectionIntent.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureResourceProtectionIntent.java new file mode 100644 index 0000000000000..699cc65ebaed1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureResourceProtectionIntent.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.ProtectionIntentInner; + +/** + * IaaS VM specific backup protection intent item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType", defaultImpl = AzureResourceProtectionIntent.class) +@JsonTypeName("AzureResourceItem") +public class AzureResourceProtectionIntent extends ProtectionIntentInner { + /** + * Friendly name of the VM represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Get friendly name of the VM represented by this backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the VM represented by this backup item. + * + * @param friendlyName the friendlyName value to set + * @return the AzureResourceProtectionIntent object itself. + */ + public AzureResourceProtectionIntent withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSQLAGWorkloadContainerProtectionContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSQLAGWorkloadContainerProtectionContainer.java new file mode 100644 index 0000000000000..a0d92b38fefad --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSQLAGWorkloadContainerProtectionContainer.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Container for SQL workloads under SQL Availability Group. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureSQLAGWorkloadContainerProtectionContainer.class) +@JsonTypeName("SQLAGWorkLoadContainer") +public class AzureSQLAGWorkloadContainerProtectionContainer extends AzureWorkloadContainer { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlContainer.java new file mode 100644 index 0000000000000..4ed0d858af849 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * Azure Sql workload-specific container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureSqlContainer.class) +@JsonTypeName("AzureSqlContainer") +public class AzureSqlContainer extends ProtectionContainerInner { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectedItem.java new file mode 100644 index 0000000000000..8a737d24b76d0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectedItem.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure SQL workload-specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureSqlProtectedItem.class) +@JsonTypeName("Microsoft.Sql/servers/databases") +public class AzureSqlProtectedItem extends ProtectedItem { + /** + * Internal ID of a backup item. Used by Azure SQL Backup engine to contact + * Recovery Services. + */ + @JsonProperty(value = "protectedItemDataId") + private String protectedItemDataId; + + /** + * Backup state of the backed up 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 internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. + * + * @return the protectedItemDataId value + */ + public String protectedItemDataId() { + return this.protectedItemDataId; + } + + /** + * Set internal ID of a backup item. Used by 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 backup state of the backed up item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @return the protectionState value + */ + public ProtectedItemState protectionState() { + return this.protectionState; + } + + /** + * Set backup state of the backed up 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectedItemExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..b8fd475d1328a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information on Azure Sql specific protected item. + */ +public class AzureSqlProtectedItemExtendedInfo { + /** + * The oldest backup copy available for this item in the service. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * Number of available backup copies associated with this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * 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 number of available backup copies associated with this backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set number of available backup copies associated with 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 state of the backup policy associated with this backup item. + * + * @return the policyState value + */ + public String policyState() { + return this.policyState; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectionPolicy.java new file mode 100644 index 0000000000000..ed44e1d350179 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureSqlProtectionPolicy.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure SQL workload-specific backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType", defaultImpl = AzureSqlProtectionPolicy.class) +@JsonTypeName("AzureSql") +public class AzureSqlProtectionPolicy extends ProtectionPolicy { + /** + * Retention policy details. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get retention policy details. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageContainer.java new file mode 100644 index 0000000000000..c3034683270da --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageContainer.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * Azure Storage Account workload-specific container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureStorageContainer.class) +@JsonTypeName("StorageContainer") +public class AzureStorageContainer extends ProtectionContainerInner { + /** + * Fully qualified ARM url. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * Storage account version. + */ + @JsonProperty(value = "storageAccountVersion") + private String storageAccountVersion; + + /** + * Resource group name of Recovery Services Vault. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * Number of items backed up in this container. + */ + @JsonProperty(value = "protectedItemCount") + private Long protectedItemCount; + + /** + * Get fully qualified ARM url. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set fully qualified ARM url. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get storage account version. + * + * @return the storageAccountVersion value + */ + public String storageAccountVersion() { + return this.storageAccountVersion; + } + + /** + * Set storage account version. + * + * @param storageAccountVersion the storageAccountVersion value to set + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withStorageAccountVersion(String storageAccountVersion) { + this.storageAccountVersion = storageAccountVersion; + return this; + } + + /** + * Get resource group name of Recovery Services Vault. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set resource group name of Recovery Services Vault. + * + * @param resourceGroup the resourceGroup value to set + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get number of items backed up in this container. + * + * @return the protectedItemCount value + */ + public Long protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set number of items backed up in this container. + * + * @param protectedItemCount the protectedItemCount value to set + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withProtectedItemCount(Long protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageErrorInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageErrorInfo.java new file mode 100644 index 0000000000000..c22cffce27597 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageErrorInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure storage specific error information. + */ +public class AzureStorageErrorInfo { + /** + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /** + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /** + * List of localized recommendations for above error code. + */ + @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 AzureStorageErrorInfo object itself. + */ + public AzureStorageErrorInfo withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + 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 AzureStorageErrorInfo object itself. + */ + public AzureStorageErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get list of localized recommendations for above error code. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set list of localized recommendations for above error code. + * + * @param recommendations the recommendations value to set + * @return the AzureStorageErrorInfo object itself. + */ + public AzureStorageErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJob.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJob.java new file mode 100644 index 0000000000000..52c3e3d9f59fd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJob.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.JobInner; + +/** + * Azure storage specific job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType", defaultImpl = AzureStorageJob.class) +@JsonTypeName("AzureStorageJob") +public class AzureStorageJob extends JobInner { + /** + * Time elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /** + * Error details on execution of this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Specifies friendly name of the storage account. + */ + @JsonProperty(value = "storageAccountName") + private String storageAccountName; + + /** + * Specifies whether the Storage account is a Classic or an Azure Resource + * Manager Storage account. + */ + @JsonProperty(value = "storageAccountVersion") + private String storageAccountVersion; + + /** + * Additional information about the job. + */ + @JsonProperty(value = "extendedInfo") + private AzureStorageJobExtendedInfo extendedInfo; + + /** + * Get time elapsed during the execution of this job. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set time elapsed during the execution of this job. + * + * @param duration the duration value to set + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set gets or sets the state/actions applicable on this job like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get error details on execution of this job. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set error details on execution of this job. + * + * @param errorDetails the errorDetails value to set + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get specifies friendly name of the storage account. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set specifies friendly name of the storage account. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + * + * @return the storageAccountVersion value + */ + public String storageAccountVersion() { + return this.storageAccountVersion; + } + + /** + * Set specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. + * + * @param storageAccountVersion the storageAccountVersion value to set + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withStorageAccountVersion(String storageAccountVersion) { + this.storageAccountVersion = storageAccountVersion; + return this; + } + + /** + * Get additional information about the job. + * + * @return the extendedInfo value + */ + public AzureStorageJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information about the job. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureStorageJob object itself. + */ + public AzureStorageJob withExtendedInfo(AzureStorageJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJobExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJobExtendedInfo.java new file mode 100644 index 0000000000000..1c4abc920ab8c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJobExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Storage workload-specific additional information for job. + */ +public class AzureStorageJobExtendedInfo { + /** + * List of tasks for this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /** + * 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 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 AzureStorageJobExtendedInfo object itself. + */ + public AzureStorageJobExtendedInfo 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 AzureStorageJobExtendedInfo object itself. + */ + public AzureStorageJobExtendedInfo 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 AzureStorageJobExtendedInfo object itself. + */ + public AzureStorageJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJobTaskDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJobTaskDetails.java new file mode 100644 index 0000000000000..b015c5c7d493b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageJobTaskDetails.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure storage workload specific job task details. + */ +public class AzureStorageJobTaskDetails { + /** + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /** + * 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 AzureStorageJobTaskDetails object itself. + */ + public AzureStorageJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + 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 AzureStorageJobTaskDetails object itself. + */ + public AzureStorageJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageProtectableContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageProtectableContainer.java new file mode 100644 index 0000000000000..9f9e5791b716d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureStorageProtectableContainer.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectableContainerInner; + +/** + * Azure Storage-specific protectable containers. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableContainerType", defaultImpl = AzureStorageProtectableContainer.class) +@JsonTypeName("StorageContainer") +public class AzureStorageProtectableContainer extends ProtectableContainerInner { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMAppContainerProtectableContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMAppContainerProtectableContainer.java new file mode 100644 index 0000000000000..5b3c3e93c7d13 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMAppContainerProtectableContainer.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectableContainerInner; + +/** + * Azure workload-specific container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableContainerType", defaultImpl = AzureVMAppContainerProtectableContainer.class) +@JsonTypeName("VMAppContainer") +public class AzureVMAppContainerProtectableContainer extends ProtectableContainerInner { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMAppContainerProtectionContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMAppContainerProtectionContainer.java new file mode 100644 index 0000000000000..5f9920550031d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMAppContainerProtectionContainer.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Container for SQL workloads under Azure Virtual Machines. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureVMAppContainerProtectionContainer.class) +@JsonTypeName("VMAppContainer") +public class AzureVMAppContainerProtectionContainer extends AzureWorkloadContainer { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMResourceFeatureSupportRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMResourceFeatureSupportRequest.java new file mode 100644 index 0000000000000..162bf9db3f75c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMResourceFeatureSupportRequest.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureResource(IaaS VM) Specific feature support request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "featureType", defaultImpl = AzureVMResourceFeatureSupportRequest.class) +@JsonTypeName("AzureVMResourceBackup") +public class AzureVMResourceFeatureSupportRequest extends FeatureSupportRequest { + /** + * Size of the resource: VM size(A/D series etc) in case of IaasVM. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * SKUs (Premium/Managed etc) in case of IaasVM. + */ + @JsonProperty(value = "vmSku") + private String vmSku; + + /** + * Get size of the resource: VM size(A/D series etc) in case of IaasVM. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set size of the resource: VM size(A/D series etc) in case of IaasVM. + * + * @param vmSize the vmSize value to set + * @return the AzureVMResourceFeatureSupportRequest object itself. + */ + public AzureVMResourceFeatureSupportRequest withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get sKUs (Premium/Managed etc) in case of IaasVM. + * + * @return the vmSku value + */ + public String vmSku() { + return this.vmSku; + } + + /** + * Set sKUs (Premium/Managed etc) in case of IaasVM. + * + * @param vmSku the vmSku value to set + * @return the AzureVMResourceFeatureSupportRequest object itself. + */ + public AzureVMResourceFeatureSupportRequest withVmSku(String vmSku) { + this.vmSku = vmSku; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMResourceFeatureSupportResponse.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMResourceFeatureSupportResponse.java new file mode 100644 index 0000000000000..0853c8217669c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVMResourceFeatureSupportResponse.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.AzureVMResourceFeatureSupportResponseInner; + +/** + * Type representing AzureVMResourceFeatureSupportResponse. + */ +public interface AzureVMResourceFeatureSupportResponse extends HasInner, HasManager { + /** + * @return the supportStatus value. + */ + SupportStatus supportStatus(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadItem.java new file mode 100644 index 0000000000000..37c6334e891ab --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Azure VM workload-specific workload item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = AzureVmWorkloadItem.class) +@JsonTypeName("AzureVmWorkloadItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SAPAseDatabase", value = AzureVmWorkloadSAPAseDatabaseWorkloadItem.class), + @JsonSubTypes.Type(name = "SAPAseSystem", value = AzureVmWorkloadSAPAseSystemWorkloadItem.class), + @JsonSubTypes.Type(name = "SAPHanaDatabase", value = AzureVmWorkloadSAPHanaDatabaseWorkloadItem.class), + @JsonSubTypes.Type(name = "SAPHanaSystem", value = AzureVmWorkloadSAPHanaSystemWorkloadItem.class), + @JsonSubTypes.Type(name = "SQLDataBase", value = AzureVmWorkloadSQLDatabaseWorkloadItem.class), + @JsonSubTypes.Type(name = "SQLInstance", value = AzureVmWorkloadSQLInstanceWorkloadItem.class) +}) +public class AzureVmWorkloadItem extends WorkloadItem { + /** + * Name for instance or AG. + */ + @JsonProperty(value = "parentName") + private String parentName; + + /** + * Host/Cluster Name for instance or AG. + */ + @JsonProperty(value = "serverName") + private String serverName; + + /** + * Indicates if workload item is auto-protectable. + */ + @JsonProperty(value = "isAutoProtectable") + private Boolean isAutoProtectable; + + /** + * For instance or AG, indicates number of DB's present. + */ + @JsonProperty(value = "subinquireditemcount") + private Integer subinquireditemcount; + + /** + * For instance or AG, indicates number of DB's to be protected. + */ + @JsonProperty(value = "subWorkloadItemCount") + private Integer subWorkloadItemCount; + + /** + * Get name for instance or AG. + * + * @return the parentName value + */ + public String parentName() { + return this.parentName; + } + + /** + * Set name for instance or AG. + * + * @param parentName the parentName value to set + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get host/Cluster Name for instance or AG. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set host/Cluster Name for instance or AG. + * + * @param serverName the serverName value to set + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get indicates if workload item is auto-protectable. + * + * @return the isAutoProtectable value + */ + public Boolean isAutoProtectable() { + return this.isAutoProtectable; + } + + /** + * Set indicates if workload item is auto-protectable. + * + * @param isAutoProtectable the isAutoProtectable value to set + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { + this.isAutoProtectable = isAutoProtectable; + return this; + } + + /** + * Get for instance or AG, indicates number of DB's present. + * + * @return the subinquireditemcount value + */ + public Integer subinquireditemcount() { + return this.subinquireditemcount; + } + + /** + * Set for instance or AG, indicates number of DB's present. + * + * @param subinquireditemcount the subinquireditemcount value to set + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { + this.subinquireditemcount = subinquireditemcount; + return this; + } + + /** + * Get for instance or AG, indicates number of DB's to be protected. + * + * @return the subWorkloadItemCount value + */ + public Integer subWorkloadItemCount() { + return this.subWorkloadItemCount; + } + + /** + * Set for instance or AG, indicates number of DB's to be protected. + * + * @param subWorkloadItemCount the subWorkloadItemCount value to set + * @return the AzureVmWorkloadItem object itself. + */ + public AzureVmWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { + this.subWorkloadItemCount = subWorkloadItemCount; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectableItem.java new file mode 100644 index 0000000000000..aa9a1b749990c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectableItem.java @@ -0,0 +1,245 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Azure VM workload-specific protectable item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureVmWorkloadProtectableItem.class) +@JsonTypeName("AzureVmWorkloadProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SAPAseSystem", value = AzureVmWorkloadSAPAseSystemProtectableItem.class), + @JsonSubTypes.Type(name = "SAPHanaDatabase", value = AzureVmWorkloadSAPHanaDatabaseProtectableItem.class), + @JsonSubTypes.Type(name = "SAPHanaSystem", value = AzureVmWorkloadSAPHanaSystemProtectableItem.class), + @JsonSubTypes.Type(name = "SQLAvailabilityGroupContainer", value = AzureVmWorkloadSQLAvailabilityGroupProtectableItem.class), + @JsonSubTypes.Type(name = "SQLDataBase", value = AzureVmWorkloadSQLDatabaseProtectableItem.class), + @JsonSubTypes.Type(name = "SQLInstance", value = AzureVmWorkloadSQLInstanceProtectableItem.class) +}) +public class AzureVmWorkloadProtectableItem extends WorkloadProtectableItem { + /** + * Name for instance or AG. + */ + @JsonProperty(value = "parentName") + private String parentName; + + /** + * Parent Unique Name is added to provide the service formatted URI Name of + * the Parent + * Only Applicable for data bases where the parent would be either Instance + * or a SQL AG. + */ + @JsonProperty(value = "parentUniqueName") + private String parentUniqueName; + + /** + * Host/Cluster Name for instance or AG. + */ + @JsonProperty(value = "serverName") + private String serverName; + + /** + * Indicates if protectable item is auto-protectable. + */ + @JsonProperty(value = "isAutoProtectable") + private Boolean isAutoProtectable; + + /** + * Indicates if protectable item is auto-protected. + */ + @JsonProperty(value = "isAutoProtected") + private Boolean isAutoProtected; + + /** + * For instance or AG, indicates number of DB's present. + */ + @JsonProperty(value = "subinquireditemcount") + private Integer subinquireditemcount; + + /** + * For instance or AG, indicates number of DB's to be protected. + */ + @JsonProperty(value = "subprotectableitemcount") + private Integer subprotectableitemcount; + + /** + * Pre-backup validation for protectable objects. + */ + @JsonProperty(value = "prebackupvalidation") + private PreBackupValidation prebackupvalidation; + + /** + * Get name for instance or AG. + * + * @return the parentName value + */ + public String parentName() { + return this.parentName; + } + + /** + * Set name for instance or AG. + * + * @param parentName the parentName value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get parent Unique Name is added to provide the service formatted URI Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + * + * @return the parentUniqueName value + */ + public String parentUniqueName() { + return this.parentUniqueName; + } + + /** + * Set parent Unique Name is added to provide the service formatted URI Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + * + * @param parentUniqueName the parentUniqueName value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withParentUniqueName(String parentUniqueName) { + this.parentUniqueName = parentUniqueName; + return this; + } + + /** + * Get host/Cluster Name for instance or AG. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set host/Cluster Name for instance or AG. + * + * @param serverName the serverName value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get indicates if protectable item is auto-protectable. + * + * @return the isAutoProtectable value + */ + public Boolean isAutoProtectable() { + return this.isAutoProtectable; + } + + /** + * Set indicates if protectable item is auto-protectable. + * + * @param isAutoProtectable the isAutoProtectable value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { + this.isAutoProtectable = isAutoProtectable; + return this; + } + + /** + * Get indicates if protectable item is auto-protected. + * + * @return the isAutoProtected value + */ + public Boolean isAutoProtected() { + return this.isAutoProtected; + } + + /** + * Set indicates if protectable item is auto-protected. + * + * @param isAutoProtected the isAutoProtected value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withIsAutoProtected(Boolean isAutoProtected) { + this.isAutoProtected = isAutoProtected; + return this; + } + + /** + * Get for instance or AG, indicates number of DB's present. + * + * @return the subinquireditemcount value + */ + public Integer subinquireditemcount() { + return this.subinquireditemcount; + } + + /** + * Set for instance or AG, indicates number of DB's present. + * + * @param subinquireditemcount the subinquireditemcount value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { + this.subinquireditemcount = subinquireditemcount; + return this; + } + + /** + * Get for instance or AG, indicates number of DB's to be protected. + * + * @return the subprotectableitemcount value + */ + public Integer subprotectableitemcount() { + return this.subprotectableitemcount; + } + + /** + * Set for instance or AG, indicates number of DB's to be protected. + * + * @param subprotectableitemcount the subprotectableitemcount value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { + this.subprotectableitemcount = subprotectableitemcount; + return this; + } + + /** + * Get pre-backup validation for protectable objects. + * + * @return the prebackupvalidation value + */ + public PreBackupValidation prebackupvalidation() { + return this.prebackupvalidation; + } + + /** + * Set pre-backup validation for protectable objects. + * + * @param prebackupvalidation the prebackupvalidation value to set + * @return the AzureVmWorkloadProtectableItem object itself. + */ + public AzureVmWorkloadProtectableItem withPrebackupvalidation(PreBackupValidation prebackupvalidation) { + this.prebackupvalidation = prebackupvalidation; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectedItem.java new file mode 100644 index 0000000000000..cbfb37fc8a4ee --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectedItem.java @@ -0,0 +1,375 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Azure VM workload-specific protected item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureVmWorkloadProtectedItem.class) +@JsonTypeName("AzureVmWorkloadProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureVmWorkloadSAPAseDatabase", value = AzureVmWorkloadSAPAseDatabaseProtectedItem.class), + @JsonSubTypes.Type(name = "AzureVmWorkloadSAPHanaDatabase", value = AzureVmWorkloadSAPHanaDatabaseProtectedItem.class), + @JsonSubTypes.Type(name = "AzureVmWorkloadSQLDatabase", value = AzureVmWorkloadSQLDatabaseProtectedItem.class) +}) +public class AzureVmWorkloadProtectedItem extends ProtectedItem { + /** + * Friendly name of the DB represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Host/Cluster Name for instance or AG. + */ + @JsonProperty(value = "serverName") + private String serverName; + + /** + * Parent name of the DB such as Instance or Availability Group. + */ + @JsonProperty(value = "parentName") + private String parentName; + + /** + * Parent type of protected item, example: for a DB, standalone server or + * distributed. + */ + @JsonProperty(value = "parentType") + private String parentType; + + /** + * Backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /** + * Backup state of this backup item. Possible values include: 'Invalid', + * 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', + * 'ProtectionPaused'. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /** + * Last backup operation status. Possible values: Healthy, Unhealthy. + * Possible values include: 'Invalid', 'Healthy', 'Unhealthy', 'IRPending'. + */ + @JsonProperty(value = "lastBackupStatus") + private LastBackupStatus lastBackupStatus; + + /** + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private DateTime lastBackupTime; + + /** + * Error details in last backup. + */ + @JsonProperty(value = "lastBackupErrorDetail") + private ErrorDetail lastBackupErrorDetail; + + /** + * Data ID of the protected item. + */ + @JsonProperty(value = "protectedItemDataSourceId") + private String protectedItemDataSourceId; + + /** + * Health status of the backup item, evaluated based on last heartbeat + * received. Possible values include: 'Invalid', 'Healthy', 'Unhealthy', + * 'NotReachable', 'IRPending'. + */ + @JsonProperty(value = "protectedItemHealthStatus") + private ProtectedItemHealthStatus protectedItemHealthStatus; + + /** + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureVmWorkloadProtectedItemExtendedInfo extendedInfo; + + /** + * Health details of different KPIs. + */ + @JsonProperty(value = "kpisHealths") + private Map kpisHealths; + + /** + * Get friendly name of the DB represented by this backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the DB represented by this backup item. + * + * @param friendlyName the friendlyName value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get host/Cluster Name for instance or AG. + * + * @return the serverName value + */ + public String serverName() { + return this.serverName; + } + + /** + * Set host/Cluster Name for instance or AG. + * + * @param serverName the serverName value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get parent name of the DB such as Instance or Availability Group. + * + * @return the parentName value + */ + public String parentName() { + return this.parentName; + } + + /** + * Set parent name of the DB such as Instance or Availability Group. + * + * @param parentName the parentName value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get parent type of protected item, example: for a DB, standalone server or distributed. + * + * @return the parentType value + */ + public String parentType() { + return this.parentType; + } + + /** + * Set parent type of protected item, example: for a DB, standalone server or distributed. + * + * @param parentType the parentType value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withParentType(String parentType) { + this.parentType = parentType; + return this; + } + + /** + * Get backup status of this backup item. + * + * @return the protectionStatus value + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set backup status of this backup item. + * + * @param protectionStatus the protectionStatus value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get 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 backup state of this backup item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @param protectionState the protectionState value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'Invalid', 'Healthy', 'Unhealthy', 'IRPending'. + * + * @return the lastBackupStatus value + */ + public LastBackupStatus lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set last backup operation status. Possible values: Healthy, Unhealthy. Possible values include: 'Invalid', 'Healthy', 'Unhealthy', 'IRPending'. + * + * @param lastBackupStatus the lastBackupStatus value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value + */ + public DateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withLastBackupTime(DateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get error details in last backup. + * + * @return the lastBackupErrorDetail value + */ + public ErrorDetail lastBackupErrorDetail() { + return this.lastBackupErrorDetail; + } + + /** + * Set error details in last backup. + * + * @param lastBackupErrorDetail the lastBackupErrorDetail value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { + this.lastBackupErrorDetail = lastBackupErrorDetail; + return this; + } + + /** + * Get data ID of the protected item. + * + * @return the protectedItemDataSourceId value + */ + public String protectedItemDataSourceId() { + return this.protectedItemDataSourceId; + } + + /** + * Set data ID of the protected item. + * + * @param protectedItemDataSourceId the protectedItemDataSourceId value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { + this.protectedItemDataSourceId = protectedItemDataSourceId; + return this; + } + + /** + * Get health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'Invalid', 'Healthy', 'Unhealthy', 'NotReachable', 'IRPending'. + * + * @return the protectedItemHealthStatus value + */ + public ProtectedItemHealthStatus protectedItemHealthStatus() { + return this.protectedItemHealthStatus; + } + + /** + * Set health status of the backup item, evaluated based on last heartbeat received. Possible values include: 'Invalid', 'Healthy', 'Unhealthy', 'NotReachable', 'IRPending'. + * + * @param protectedItemHealthStatus the protectedItemHealthStatus value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { + this.protectedItemHealthStatus = protectedItemHealthStatus; + return this; + } + + /** + * Get additional information for this backup item. + * + * @return the extendedInfo value + */ + public AzureVmWorkloadProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get health details of different KPIs. + * + * @return the kpisHealths value + */ + public Map kpisHealths() { + return this.kpisHealths; + } + + /** + * Set health details of different KPIs. + * + * @param kpisHealths the kpisHealths value to set + * @return the AzureVmWorkloadProtectedItem object itself. + */ + public AzureVmWorkloadProtectedItem withKpisHealths(Map kpisHealths) { + this.kpisHealths = kpisHealths; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectedItemExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..59573c4b62a92 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectedItemExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information on Azure Workload for SQL specific backup item. + */ +public class AzureVmWorkloadProtectedItemExtendedInfo { + /** + * The oldest backup copy available for this backup item. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * Number of backup copies available for this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Indicates consistency of policy object and policy applied to this backup + * item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /** + * 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 AzureVmWorkloadProtectedItemExtendedInfo object itself. + */ + public AzureVmWorkloadProtectedItemExtendedInfo withOldestRecoveryPoint(DateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get number of backup copies available for this backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set number of backup copies available for this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set + * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. + */ + public AzureVmWorkloadProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value + */ + public String policyState() { + return this.policyState; + } + + /** + * Set indicates consistency of policy object and policy applied to this backup item. + * + * @param policyState the policyState value to set + * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. + */ + public AzureVmWorkloadProtectedItemExtendedInfo withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectionPolicy.java new file mode 100644 index 0000000000000..e1ea922087379 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadProtectionPolicy.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM (Mercury) workload-specific backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType", defaultImpl = AzureVmWorkloadProtectionPolicy.class) +@JsonTypeName("AzureWorkload") +public class AzureVmWorkloadProtectionPolicy extends ProtectionPolicy { + /** + * Type of workload for the backup management. Possible values include: + * 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + * 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + * 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workLoadType") + private WorkloadType workLoadType; + + /** + * Common settings for the backup management. + */ + @JsonProperty(value = "settings") + private Settings settings; + + /** + * List of sub-protection policies which includes schedule and retention. + */ + @JsonProperty(value = "subProtectionPolicy") + private List subProtectionPolicy; + + /** + * Fix the policy inconsistency. + */ + @JsonProperty(value = "makePolicyConsistent") + private Boolean makePolicyConsistent; + + /** + * Get type of workload for the backup management. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workLoadType value + */ + public WorkloadType workLoadType() { + return this.workLoadType; + } + + /** + * Set type of workload for the backup management. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workLoadType the workLoadType value to set + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withWorkLoadType(WorkloadType workLoadType) { + this.workLoadType = workLoadType; + return this; + } + + /** + * Get common settings for the backup management. + * + * @return the settings value + */ + public Settings settings() { + return this.settings; + } + + /** + * Set common settings for the backup management. + * + * @param settings the settings value to set + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withSettings(Settings settings) { + this.settings = settings; + return this; + } + + /** + * Get list of sub-protection policies which includes schedule and retention. + * + * @return the subProtectionPolicy value + */ + public List subProtectionPolicy() { + return this.subProtectionPolicy; + } + + /** + * Set list of sub-protection policies which includes schedule and retention. + * + * @param subProtectionPolicy the subProtectionPolicy value to set + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withSubProtectionPolicy(List subProtectionPolicy) { + this.subProtectionPolicy = subProtectionPolicy; + return this; + } + + /** + * Get fix the policy inconsistency. + * + * @return the makePolicyConsistent value + */ + public Boolean makePolicyConsistent() { + return this.makePolicyConsistent; + } + + /** + * Set fix the policy inconsistency. + * + * @param makePolicyConsistent the makePolicyConsistent value to set + * @return the AzureVmWorkloadProtectionPolicy object itself. + */ + public AzureVmWorkloadProtectionPolicy withMakePolicyConsistent(Boolean makePolicyConsistent) { + this.makePolicyConsistent = makePolicyConsistent; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseDatabaseProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseDatabaseProtectedItem.java new file mode 100644 index 0000000000000..19853016f64dd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseDatabaseProtectedItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protected item representing SAP ASE Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureVmWorkloadSAPAseDatabaseProtectedItem.class) +@JsonTypeName("AzureVmWorkloadSAPAseDatabase") +public class AzureVmWorkloadSAPAseDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseDatabaseWorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseDatabaseWorkloadItem.java new file mode 100644 index 0000000000000..346fb11e1b6d2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseDatabaseWorkloadItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific workload item representing SAP ASE Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = AzureVmWorkloadSAPAseDatabaseWorkloadItem.class) +@JsonTypeName("SAPAseDatabase") +public class AzureVmWorkloadSAPAseDatabaseWorkloadItem extends AzureVmWorkloadItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseSystemProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseSystemProtectableItem.java new file mode 100644 index 0000000000000..84b9d3e8c80f8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseSystemProtectableItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protectable item representing SAP ASE System. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureVmWorkloadSAPAseSystemProtectableItem.class) +@JsonTypeName("SAPAseSystem") +public class AzureVmWorkloadSAPAseSystemProtectableItem extends AzureVmWorkloadProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseSystemWorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseSystemWorkloadItem.java new file mode 100644 index 0000000000000..f5cb6232d85d0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPAseSystemWorkloadItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific workload item representing SAP ASE System. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = AzureVmWorkloadSAPAseSystemWorkloadItem.class) +@JsonTypeName("SAPAseSystem") +public class AzureVmWorkloadSAPAseSystemWorkloadItem extends AzureVmWorkloadItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseProtectableItem.java new file mode 100644 index 0000000000000..7683ce1173a33 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseProtectableItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protectable item representing SAP HANA Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureVmWorkloadSAPHanaDatabaseProtectableItem.class) +@JsonTypeName("SAPHanaDatabase") +public class AzureVmWorkloadSAPHanaDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseProtectedItem.java new file mode 100644 index 0000000000000..75d8f6c30c5e4 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseProtectedItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protected item representing SAP HANA Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureVmWorkloadSAPHanaDatabaseProtectedItem.class) +@JsonTypeName("AzureVmWorkloadSAPHanaDatabase") +public class AzureVmWorkloadSAPHanaDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseWorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseWorkloadItem.java new file mode 100644 index 0000000000000..67e1e01bb1b0e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaDatabaseWorkloadItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific workload item representing SAP HANA Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = AzureVmWorkloadSAPHanaDatabaseWorkloadItem.class) +@JsonTypeName("SAPHanaDatabase") +public class AzureVmWorkloadSAPHanaDatabaseWorkloadItem extends AzureVmWorkloadItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaSystemProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaSystemProtectableItem.java new file mode 100644 index 0000000000000..502dfd533a415 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaSystemProtectableItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protectable item representing SAP HANA System. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureVmWorkloadSAPHanaSystemProtectableItem.class) +@JsonTypeName("SAPHanaSystem") +public class AzureVmWorkloadSAPHanaSystemProtectableItem extends AzureVmWorkloadProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaSystemWorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaSystemWorkloadItem.java new file mode 100644 index 0000000000000..59c66fc04c6ae --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSAPHanaSystemWorkloadItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific workload item representing SAP HANA System. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = AzureVmWorkloadSAPHanaSystemWorkloadItem.class) +@JsonTypeName("SAPHanaSystem") +public class AzureVmWorkloadSAPHanaSystemWorkloadItem extends AzureVmWorkloadItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.java new file mode 100644 index 0000000000000..8aa0faa6cc1dd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protectable item representing SQL Availability + * Group. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureVmWorkloadSQLAvailabilityGroupProtectableItem.class) +@JsonTypeName("SQLAvailabilityGroupContainer") +public class AzureVmWorkloadSQLAvailabilityGroupProtectableItem extends AzureVmWorkloadProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseProtectableItem.java new file mode 100644 index 0000000000000..d8cc1e4c756a7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseProtectableItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protectable item representing SQL Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureVmWorkloadSQLDatabaseProtectableItem.class) +@JsonTypeName("SQLDataBase") +public class AzureVmWorkloadSQLDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseProtectedItem.java new file mode 100644 index 0000000000000..b8b4ab16f11d7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseProtectedItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protected item representing SQL Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = AzureVmWorkloadSQLDatabaseProtectedItem.class) +@JsonTypeName("AzureVmWorkloadSQLDatabase") +public class AzureVmWorkloadSQLDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseWorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseWorkloadItem.java new file mode 100644 index 0000000000000..ff589ee830b05 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLDatabaseWorkloadItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific workload item representing SQL Database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = AzureVmWorkloadSQLDatabaseWorkloadItem.class) +@JsonTypeName("SQLDataBase") +public class AzureVmWorkloadSQLDatabaseWorkloadItem extends AzureVmWorkloadItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLInstanceProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLInstanceProtectableItem.java new file mode 100644 index 0000000000000..e481474ca0823 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLInstanceProtectableItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific protectable item representing SQL Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = AzureVmWorkloadSQLInstanceProtectableItem.class) +@JsonTypeName("SQLInstance") +public class AzureVmWorkloadSQLInstanceProtectableItem extends AzureVmWorkloadProtectableItem { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLInstanceWorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLInstanceWorkloadItem.java new file mode 100644 index 0000000000000..99af56b132ca2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureVmWorkloadSQLInstanceWorkloadItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM workload-specific workload item representing SQL Instance. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = AzureVmWorkloadSQLInstanceWorkloadItem.class) +@JsonTypeName("SQLInstance") +public class AzureVmWorkloadSQLInstanceWorkloadItem extends AzureVmWorkloadItem { + /** + * Data Directory Paths for default directories. + */ + @JsonProperty(value = "dataDirectoryPaths") + private List dataDirectoryPaths; + + /** + * Get data Directory Paths for default directories. + * + * @return the dataDirectoryPaths value + */ + public List dataDirectoryPaths() { + return this.dataDirectoryPaths; + } + + /** + * Set data Directory Paths for default directories. + * + * @param dataDirectoryPaths the dataDirectoryPaths value to set + * @return the AzureVmWorkloadSQLInstanceWorkloadItem object itself. + */ + public AzureVmWorkloadSQLInstanceWorkloadItem withDataDirectoryPaths(List dataDirectoryPaths) { + this.dataDirectoryPaths = dataDirectoryPaths; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadAutoProtectionIntent.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadAutoProtectionIntent.java new file mode 100644 index 0000000000000..12e3860450b81 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadAutoProtectionIntent.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Azure Recovery Services Vault specific protection intent item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType", defaultImpl = AzureWorkloadAutoProtectionIntent.class) +@JsonTypeName("AzureWorkloadAutoProtectionIntent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureWorkloadSQLAutoProtectionIntent", value = AzureWorkloadSQLAutoProtectionIntent.class) +}) +public class AzureWorkloadAutoProtectionIntent extends AzureRecoveryServiceVaultProtectionIntent { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadContainer.java new file mode 100644 index 0000000000000..e8ef142877257 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadContainer.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * Container for the workloads running inside Azure Compute or Classic Compute. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = AzureWorkloadContainer.class) +@JsonTypeName("AzureWorkloadContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SQLAGWorkLoadContainer", value = AzureSQLAGWorkloadContainerProtectionContainer.class), + @JsonSubTypes.Type(name = "VMAppContainer", value = AzureVMAppContainerProtectionContainer.class) +}) +public class AzureWorkloadContainer extends ProtectionContainerInner { + /** + * ARM ID of the virtual machine represented by this Azure Workload + * Container. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * Time stamp when this container was updated. + */ + @JsonProperty(value = "lastUpdatedTime") + private DateTime lastUpdatedTime; + + /** + * Additional details of a workload container. + */ + @JsonProperty(value = "extendedInfo") + private AzureWorkloadContainerExtendedInfo extendedInfo; + + /** + * Workload type for which registration was sent. Possible values include: + * 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + * 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + * 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /** + * Re-Do Operation. Possible values include: 'Invalid', 'Register', + * 'Reregister'. + */ + @JsonProperty(value = "operationType") + private OperationType operationType; + + /** + * Get aRM ID of the virtual machine represented by this Azure Workload Container. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set aRM ID of the virtual machine represented by this Azure Workload Container. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get time stamp when this container was updated. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set time stamp when this container was updated. + * + * @param lastUpdatedTime the lastUpdatedTime value to set + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withLastUpdatedTime(DateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get additional details of a workload container. + * + * @return the extendedInfo value + */ + public AzureWorkloadContainerExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional details of a workload container. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withExtendedInfo(AzureWorkloadContainerExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get workload type for which registration was sent. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workloadType value + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set workload type for which registration was sent. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workloadType the workloadType value to set + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get re-Do Operation. Possible values include: 'Invalid', 'Register', 'Reregister'. + * + * @return the operationType value + */ + public OperationType operationType() { + return this.operationType; + } + + /** + * Set re-Do Operation. Possible values include: 'Invalid', 'Register', 'Reregister'. + * + * @param operationType the operationType value to set + * @return the AzureWorkloadContainer object itself. + */ + public AzureWorkloadContainer withOperationType(OperationType operationType) { + this.operationType = operationType; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadContainerExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadContainerExtendedInfo.java new file mode 100644 index 0000000000000..839e9911c85b3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadContainerExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Extended information of the container. + */ +public class AzureWorkloadContainerExtendedInfo { + /** + * Host Os Name in case of Stand Alone and Cluster Name in case of + * distributed container. + */ + @JsonProperty(value = "hostServerName") + private String hostServerName; + + /** + * Inquiry Status for the container. + */ + @JsonProperty(value = "inquiryInfo") + private InquiryInfo inquiryInfo; + + /** + * List of the nodes in case of distributed container. + */ + @JsonProperty(value = "nodesList") + private List nodesList; + + /** + * Get host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + * + * @return the hostServerName value + */ + public String hostServerName() { + return this.hostServerName; + } + + /** + * Set host Os Name in case of Stand Alone and Cluster Name in case of distributed container. + * + * @param hostServerName the hostServerName value to set + * @return the AzureWorkloadContainerExtendedInfo object itself. + */ + public AzureWorkloadContainerExtendedInfo withHostServerName(String hostServerName) { + this.hostServerName = hostServerName; + return this; + } + + /** + * Get inquiry Status for the container. + * + * @return the inquiryInfo value + */ + public InquiryInfo inquiryInfo() { + return this.inquiryInfo; + } + + /** + * Set inquiry Status for the container. + * + * @param inquiryInfo the inquiryInfo value to set + * @return the AzureWorkloadContainerExtendedInfo object itself. + */ + public AzureWorkloadContainerExtendedInfo withInquiryInfo(InquiryInfo inquiryInfo) { + this.inquiryInfo = inquiryInfo; + return this; + } + + /** + * Get list of the nodes in case of distributed container. + * + * @return the nodesList value + */ + public List nodesList() { + return this.nodesList; + } + + /** + * Set list of the nodes in case of distributed container. + * + * @param nodesList the nodesList value to set + * @return the AzureWorkloadContainerExtendedInfo object itself. + */ + public AzureWorkloadContainerExtendedInfo withNodesList(List nodesList) { + this.nodesList = nodesList; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadErrorInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadErrorInfo.java new file mode 100644 index 0000000000000..d52a11d1c9b70 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadErrorInfo.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure storage specific error information. + */ +public class AzureWorkloadErrorInfo { + /** + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /** + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /** + * Title: Typically, the entity that the error pertains to. + */ + @JsonProperty(value = "errorTitle") + private String errorTitle; + + /** + * List of localized recommendations for above error code. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Additional details for above error code. + */ + @JsonProperty(value = "additionalDetails") + private String additionalDetails; + + /** + * 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 AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + 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 AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get title: Typically, the entity that the error pertains to. + * + * @return the errorTitle value + */ + public String errorTitle() { + return this.errorTitle; + } + + /** + * Set title: Typically, the entity that the error pertains to. + * + * @param errorTitle the errorTitle value to set + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withErrorTitle(String errorTitle) { + this.errorTitle = errorTitle; + return this; + } + + /** + * Get list of localized recommendations for above error code. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set list of localized recommendations for above error code. + * + * @param recommendations the recommendations value to set + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + + /** + * Get additional details for above error code. + * + * @return the additionalDetails value + */ + public String additionalDetails() { + return this.additionalDetails; + } + + /** + * Set additional details for above error code. + * + * @param additionalDetails the additionalDetails value to set + * @return the AzureWorkloadErrorInfo object itself. + */ + public AzureWorkloadErrorInfo withAdditionalDetails(String additionalDetails) { + this.additionalDetails = additionalDetails; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJob.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJob.java new file mode 100644 index 0000000000000..89a6b1f203bae --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJob.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.JobInner; + +/** + * Azure storage specific job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType", defaultImpl = AzureWorkloadJob.class) +@JsonTypeName("AzureWorkloadJob") +public class AzureWorkloadJob extends JobInner { + /** + * Workload type of the job. + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /** + * Time elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * Gets or sets the state/actions applicable on this job like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /** + * Error details on execution of this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Additional information about the job. + */ + @JsonProperty(value = "extendedInfo") + private AzureWorkloadJobExtendedInfo extendedInfo; + + /** + * Get workload type of the job. + * + * @return the workloadType value + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set workload type of the job. + * + * @param workloadType the workloadType value to set + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get time elapsed during the execution of this job. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set time elapsed during the execution of this job. + * + * @param duration the duration value to set + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get gets or sets the state/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set gets or sets the state/actions applicable on this job like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get error details on execution of this job. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set error details on execution of this job. + * + * @param errorDetails the errorDetails value to set + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get additional information about the job. + * + * @return the extendedInfo value + */ + public AzureWorkloadJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information about the job. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureWorkloadJob object itself. + */ + public AzureWorkloadJob withExtendedInfo(AzureWorkloadJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJobExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJobExtendedInfo.java new file mode 100644 index 0000000000000..bf782548b911f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJobExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure VM workload-specific additional information for job. + */ +public class AzureWorkloadJobExtendedInfo { + /** + * List of tasks for this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /** + * 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 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 AzureWorkloadJobExtendedInfo object itself. + */ + public AzureWorkloadJobExtendedInfo 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 AzureWorkloadJobExtendedInfo object itself. + */ + public AzureWorkloadJobExtendedInfo 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 AzureWorkloadJobExtendedInfo object itself. + */ + public AzureWorkloadJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJobTaskDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJobTaskDetails.java new file mode 100644 index 0000000000000..6bfb10a408de3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadJobTaskDetails.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure VM workload specific job task details. + */ +public class AzureWorkloadJobTaskDetails { + /** + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /** + * 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 AzureWorkloadJobTaskDetails object itself. + */ + public AzureWorkloadJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + 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 AzureWorkloadJobTaskDetails object itself. + */ + public AzureWorkloadJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadPointInTimeRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadPointInTimeRestoreRequest.java new file mode 100644 index 0000000000000..a563db7d87c0f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadPointInTimeRestoreRequest.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log + * restore. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureWorkloadPointInTimeRestoreRequest.class) +@JsonTypeName("AzureWorkloadPointInTimeRestoreRequest") +public class AzureWorkloadPointInTimeRestoreRequest extends AzureWorkloadRestoreRequest { + /** + * PointInTime value. + */ + @JsonProperty(value = "pointInTime") + private DateTime pointInTime; + + /** + * Get pointInTime value. + * + * @return the pointInTime value + */ + public DateTime pointInTime() { + return this.pointInTime; + } + + /** + * Set pointInTime value. + * + * @param pointInTime the pointInTime value to set + * @return the AzureWorkloadPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadPointInTimeRestoreRequest withPointInTime(DateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadRestoreRequest.java new file mode 100644 index 0000000000000..3ebb0ad92e377 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadRestoreRequest.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * AzureWorkload-specific restore. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureWorkloadRestoreRequest.class) +@JsonTypeName("AzureWorkloadRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureWorkloadPointInTimeRestoreRequest", value = AzureWorkloadPointInTimeRestoreRequest.class), + @JsonSubTypes.Type(name = "AzureWorkloadSAPHanaRestoreRequest", value = AzureWorkloadSAPHanaRestoreRequest.class), + @JsonSubTypes.Type(name = "AzureWorkloadSQLRestoreRequest", value = AzureWorkloadSQLRestoreRequest.class) +}) +public class AzureWorkloadRestoreRequest extends RestoreRequest { + /** + * Type of this recovery. Possible values include: 'Invalid', + * 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + */ + @JsonProperty(value = "recoveryType") + private RecoveryType recoveryType; + + /** + * Fully qualified ARM ID of the VM on which workload that was running is + * being recovered. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * Workload specific property bag. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /** + * Details of target database. + */ + @JsonProperty(value = "targetInfo") + private TargetRestoreInfo targetInfo; + + /** + * Defines whether the current recovery mode is file restore or database + * restore. Possible values include: 'Invalid', 'FileRecovery', + * 'WorkloadRecovery'. + */ + @JsonProperty(value = "recoveryMode") + private RecoveryMode recoveryMode; + + /** + * Get type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + * + * @return the recoveryType value + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + * + * @param recoveryType the recoveryType value to set + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get fully qualified ARM ID of the VM on which workload that was running is being recovered. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set fully qualified ARM ID of the VM on which workload that was running is being recovered. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get workload specific property bag. + * + * @return the propertyBag value + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set workload specific property bag. + * + * @param propertyBag the propertyBag value to set + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get details of target database. + * + * @return the targetInfo value + */ + public TargetRestoreInfo targetInfo() { + return this.targetInfo; + } + + /** + * Set details of target database. + * + * @param targetInfo the targetInfo value to set + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { + this.targetInfo = targetInfo; + return this; + } + + /** + * Get defines whether the current recovery mode is file restore or database restore. Possible values include: 'Invalid', 'FileRecovery', 'WorkloadRecovery'. + * + * @return the recoveryMode value + */ + public RecoveryMode recoveryMode() { + return this.recoveryMode; + } + + /** + * Set defines whether the current recovery mode is file restore or database restore. Possible values include: 'Invalid', 'FileRecovery', 'WorkloadRecovery'. + * + * @param recoveryMode the recoveryMode value to set + * @return the AzureWorkloadRestoreRequest object itself. + */ + public AzureWorkloadRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { + this.recoveryMode = recoveryMode; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java new file mode 100644 index 0000000000000..01719a692f4e5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSAPHanaPointInTimeRestoreRequest.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log + * restore. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureWorkloadSAPHanaPointInTimeRestoreRequest.class) +@JsonTypeName("AzureWorkloadSAPHanaPointInTimeRestoreRequest") +public class AzureWorkloadSAPHanaPointInTimeRestoreRequest extends AzureWorkloadSAPHanaRestoreRequest { + /** + * PointInTime value. + */ + @JsonProperty(value = "pointInTime") + private DateTime pointInTime; + + /** + * Get pointInTime value. + * + * @return the pointInTime value + */ + public DateTime pointInTime() { + return this.pointInTime; + } + + /** + * Set pointInTime value. + * + * @param pointInTime the pointInTime value to set + * @return the AzureWorkloadSAPHanaPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadSAPHanaPointInTimeRestoreRequest withPointInTime(DateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSAPHanaRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSAPHanaRestoreRequest.java new file mode 100644 index 0000000000000..f17081fcce2fc --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSAPHanaRestoreRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * AzureWorkload SAP Hana-specific restore. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureWorkloadSAPHanaRestoreRequest.class) +@JsonTypeName("AzureWorkloadSAPHanaRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureWorkloadSAPHanaPointInTimeRestoreRequest", value = AzureWorkloadSAPHanaPointInTimeRestoreRequest.class) +}) +public class AzureWorkloadSAPHanaRestoreRequest extends AzureWorkloadRestoreRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLAutoProtectionIntent.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLAutoProtectionIntent.java new file mode 100644 index 0000000000000..6bac96ec4d2f9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLAutoProtectionIntent.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure Workload SQL Auto Protection intent item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType", defaultImpl = AzureWorkloadSQLAutoProtectionIntent.class) +@JsonTypeName("AzureWorkloadSQLAutoProtectionIntent") +public class AzureWorkloadSQLAutoProtectionIntent extends AzureWorkloadAutoProtectionIntent { + /** + * Workload item type of the item for which intent is to be set. Possible + * values include: 'Invalid', 'SQLInstance', 'SQLDataBase', + * 'SAPHanaSystem', 'SAPHanaDatabase', 'SAPAseSystem', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadItemType") + private WorkloadItemType workloadItemType; + + /** + * Get workload item type of the item for which intent is to be set. Possible values include: 'Invalid', 'SQLInstance', 'SQLDataBase', 'SAPHanaSystem', 'SAPHanaDatabase', 'SAPAseSystem', 'SAPAseDatabase'. + * + * @return the workloadItemType value + */ + public WorkloadItemType workloadItemType() { + return this.workloadItemType; + } + + /** + * Set workload item type of the item for which intent is to be set. Possible values include: 'Invalid', 'SQLInstance', 'SQLDataBase', 'SAPHanaSystem', 'SAPHanaDatabase', 'SAPAseSystem', 'SAPAseDatabase'. + * + * @param workloadItemType the workloadItemType value to set + * @return the AzureWorkloadSQLAutoProtectionIntent object itself. + */ + public AzureWorkloadSQLAutoProtectionIntent withWorkloadItemType(WorkloadItemType workloadItemType) { + this.workloadItemType = workloadItemType; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLPointInTimeRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLPointInTimeRestoreRequest.java new file mode 100644 index 0000000000000..de4a2f395fefb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLPointInTimeRestoreRequest.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureWorkload SQL -specific restore. Specifically for PointInTime/Log + * restore. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureWorkloadSQLPointInTimeRestoreRequest.class) +@JsonTypeName("AzureWorkloadSQLPointInTimeRestoreRequest") +public class AzureWorkloadSQLPointInTimeRestoreRequest extends AzureWorkloadSQLRestoreRequest { + /** + * PointInTime value. + */ + @JsonProperty(value = "pointInTime") + private DateTime pointInTime; + + /** + * Get pointInTime value. + * + * @return the pointInTime value + */ + public DateTime pointInTime() { + return this.pointInTime; + } + + /** + * Set pointInTime value. + * + * @param pointInTime the pointInTime value to set + * @return the AzureWorkloadSQLPointInTimeRestoreRequest object itself. + */ + public AzureWorkloadSQLPointInTimeRestoreRequest withPointInTime(DateTime pointInTime) { + this.pointInTime = pointInTime; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLRecoveryPointExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLRecoveryPointExtendedInfo.java new file mode 100644 index 0000000000000..d69e5245ae67d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLRecoveryPointExtendedInfo.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Extended info class details. + */ +public class AzureWorkloadSQLRecoveryPointExtendedInfo { + /** + * UTC time at which data directory info was captured. + */ + @JsonProperty(value = "dataDirectoryTimeInUTC", access = JsonProperty.Access.WRITE_ONLY) + private DateTime dataDirectoryTimeInUTC; + + /** + * List of data directory paths during restore operation. + */ + @JsonProperty(value = "dataDirectoryPaths", access = JsonProperty.Access.WRITE_ONLY) + private List dataDirectoryPaths; + + /** + * Get uTC time at which data directory info was captured. + * + * @return the dataDirectoryTimeInUTC value + */ + public DateTime dataDirectoryTimeInUTC() { + return this.dataDirectoryTimeInUTC; + } + + /** + * Get list of data directory paths during restore operation. + * + * @return the dataDirectoryPaths value + */ + public List dataDirectoryPaths() { + return this.dataDirectoryPaths; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLRestoreRequest.java new file mode 100644 index 0000000000000..e0445f5777203 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/AzureWorkloadSQLRestoreRequest.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * AzureWorkload SQL -specific restore. Specifically for full/diff restore. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = AzureWorkloadSQLRestoreRequest.class) +@JsonTypeName("AzureWorkloadSQLRestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureWorkloadSQLPointInTimeRestoreRequest", value = AzureWorkloadSQLPointInTimeRestoreRequest.class) +}) +public class AzureWorkloadSQLRestoreRequest extends AzureWorkloadRestoreRequest { + /** + * Default option set to true. If this is set to false, alternate data + * directory must be provided. + */ + @JsonProperty(value = "shouldUseAlternateTargetLocation") + private Boolean shouldUseAlternateTargetLocation; + + /** + * SQL specific property where user can chose to set no-recovery when + * restore operation is tried. + */ + @JsonProperty(value = "isNonRecoverable") + private Boolean isNonRecoverable; + + /** + * Data directory details. + */ + @JsonProperty(value = "alternateDirectoryPaths") + private List alternateDirectoryPaths; + + /** + * Get default option set to true. If this is set to false, alternate data directory must be provided. + * + * @return the shouldUseAlternateTargetLocation value + */ + public Boolean shouldUseAlternateTargetLocation() { + return this.shouldUseAlternateTargetLocation; + } + + /** + * Set default option set to true. If this is set to false, alternate data directory must be provided. + * + * @param shouldUseAlternateTargetLocation the shouldUseAlternateTargetLocation value to set + * @return the AzureWorkloadSQLRestoreRequest object itself. + */ + public AzureWorkloadSQLRestoreRequest withShouldUseAlternateTargetLocation(Boolean shouldUseAlternateTargetLocation) { + this.shouldUseAlternateTargetLocation = shouldUseAlternateTargetLocation; + return this; + } + + /** + * Get sQL specific property where user can chose to set no-recovery when restore operation is tried. + * + * @return the isNonRecoverable value + */ + public Boolean isNonRecoverable() { + return this.isNonRecoverable; + } + + /** + * Set sQL specific property where user can chose to set no-recovery when restore operation is tried. + * + * @param isNonRecoverable the isNonRecoverable value to set + * @return the AzureWorkloadSQLRestoreRequest object itself. + */ + public AzureWorkloadSQLRestoreRequest withIsNonRecoverable(Boolean isNonRecoverable) { + this.isNonRecoverable = isNonRecoverable; + return this; + } + + /** + * Get data directory details. + * + * @return the alternateDirectoryPaths value + */ + public List alternateDirectoryPaths() { + return this.alternateDirectoryPaths; + } + + /** + * Set data directory details. + * + * @param alternateDirectoryPaths the alternateDirectoryPaths value to set + * @return the AzureWorkloadSQLRestoreRequest object itself. + */ + public AzureWorkloadSQLRestoreRequest withAlternateDirectoryPaths(List alternateDirectoryPaths) { + this.alternateDirectoryPaths = alternateDirectoryPaths; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BEKDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BEKDetails.java new file mode 100644 index 0000000000000..ac6246392d039 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BEKDetails.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BEK is bitlocker encryption key. + */ +public class BEKDetails { + /** + * Secret is BEK. + */ + @JsonProperty(value = "secretUrl") + private String secretUrl; + + /** + * ID of the Key Vault where this Secret is stored. + */ + @JsonProperty(value = "secretVaultId") + private String secretVaultId; + + /** + * BEK data. + */ + @JsonProperty(value = "secretData") + private String secretData; + + /** + * Get secret is BEK. + * + * @return the secretUrl value + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set secret is BEK. + * + * @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 bEK data. + * + * @return the secretData value + */ + public String secretData() { + return this.secretData; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupEngineQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupEngineQueryObject.java new file mode 100644 index 0000000000000..dc2d5c84cfdf6 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupEngineQueryObject.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Query parameters to fetch list of backup engines. + */ +public class BMSBackupEngineQueryObject { + /** + * attribute to add extended info. + */ + @JsonProperty(value = "expand") + private String expand; + + /** + * Get attribute to add extended info. + * + * @return the expand value + */ + public String expand() { + return this.expand; + } + + /** + * Set attribute to add extended info. + * + * @param expand the expand value to set + * @return the BMSBackupEngineQueryObject object itself. + */ + public BMSBackupEngineQueryObject withExpand(String expand) { + this.expand = expand; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupEnginesQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupEnginesQueryObject.java new file mode 100644 index 0000000000000..124db4770a7dc --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupEnginesQueryObject.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Query parameters to fetch list of backup engines. + */ +public class BMSBackupEnginesQueryObject { + /** + * Backup management type for the backup engine. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Friendly name of the backup engine. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Attribute to add extended info. + */ + @JsonProperty(value = "expand") + private String expand; + + /** + * Get backup management type for the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type for the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSBackupEnginesQueryObject object itself. + */ + public BMSBackupEnginesQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get friendly name of the backup engine. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the backup engine. + * + * @param friendlyName the friendlyName value to set + * @return the BMSBackupEnginesQueryObject object itself. + */ + public BMSBackupEnginesQueryObject withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get attribute to add extended info. + * + * @return the expand value + */ + public String expand() { + return this.expand; + } + + /** + * Set attribute to add extended info. + * + * @param expand the expand value to set + * @return the BMSBackupEnginesQueryObject object itself. + */ + public BMSBackupEnginesQueryObject withExpand(String expand) { + this.expand = expand; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupSummariesQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupSummariesQueryObject.java new file mode 100644 index 0000000000000..b68292c61661a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSBackupSummariesQueryObject.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Query parameters to fetch backup summaries. + */ +public class BMSBackupSummariesQueryObject { + /** + * Backup management type for this container. Possible values include: + * 'Invalid', 'BackupProtectedItemCountSummary', + * 'BackupProtectionContainerCountSummary'. + */ + @JsonProperty(value = "type") + private Type type; + + /** + * Get backup management type for this container. Possible values include: 'Invalid', 'BackupProtectedItemCountSummary', 'BackupProtectionContainerCountSummary'. + * + * @return the type value + */ + public Type type() { + return this.type; + } + + /** + * Set backup management type for this container. Possible values include: 'Invalid', 'BackupProtectedItemCountSummary', 'BackupProtectionContainerCountSummary'. + * + * @param type the type value to set + * @return the BMSBackupSummariesQueryObject object itself. + */ + public BMSBackupSummariesQueryObject withType(Type type) { + this.type = type; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSContainerQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSContainerQueryObject.java new file mode 100644 index 0000000000000..99eb5346cdeab --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSContainerQueryObject.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The query filters that can be used with the list containers API. + */ +public class BMSContainerQueryObject { + /** + * Backup management type for this container. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType", required = true) + private BackupManagementType backupManagementType; + + /** + * Type of container for filter. Possible values include: 'Invalid', + * 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', + * 'AzureBackupServerContainer', 'MABContainer', 'Cluster', + * 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', + * 'SQLAGWorkLoadContainer', 'StorageContainer', 'GenericContainer'. + */ + @JsonProperty(value = "containerType") + private ContainerType containerType; + + /** + * Backup engine name. + */ + @JsonProperty(value = "backupEngineName") + private String backupEngineName; + + /** + * Fabric name for filter. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * Status of registration of this container with the Recovery Services + * Vault. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Friendly name of this container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Get backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSContainerQueryObject object itself. + */ + public BMSContainerQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get type of container for filter. Possible values include: 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', 'AzureBackupServerContainer', 'MABContainer', 'Cluster', 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', 'SQLAGWorkLoadContainer', 'StorageContainer', 'GenericContainer'. + * + * @return the containerType value + */ + public ContainerType containerType() { + return this.containerType; + } + + /** + * Set type of container for filter. Possible values include: 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', 'AzureBackupServerContainer', 'MABContainer', 'Cluster', 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', 'SQLAGWorkLoadContainer', 'StorageContainer', 'GenericContainer'. + * + * @param containerType the containerType value to set + * @return the BMSContainerQueryObject object itself. + */ + public BMSContainerQueryObject withContainerType(ContainerType containerType) { + this.containerType = containerType; + return this; + } + + /** + * Get backup engine name. + * + * @return the backupEngineName value + */ + public String backupEngineName() { + return this.backupEngineName; + } + + /** + * Set backup engine name. + * + * @param backupEngineName the backupEngineName value to set + * @return the BMSContainerQueryObject object itself. + */ + public BMSContainerQueryObject withBackupEngineName(String backupEngineName) { + this.backupEngineName = backupEngineName; + return this; + } + + /** + * Get fabric name for filter. + * + * @return the fabricName value + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set fabric name for filter. + * + * @param fabricName the fabricName value to set + * @return the BMSContainerQueryObject object itself. + */ + public BMSContainerQueryObject withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get status of registration of this container with the Recovery Services Vault. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of registration of this container 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 friendly name of this container. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of this 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSContainersInquiryQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSContainersInquiryQueryObject.java new file mode 100644 index 0000000000000..15ac750e3b3f8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSContainersInquiryQueryObject.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The query filters that can be used with the inquire container API. + */ +public class BMSContainersInquiryQueryObject { + /** + * Backup management type for this container. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Workload type for this container. Possible values include: 'Invalid', + * 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + * 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + * 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /** + * Get backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSContainersInquiryQueryObject object itself. + */ + public BMSContainersInquiryQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get workload type for this container. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workloadType value + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set workload type for this container. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workloadType the workloadType value to set + * @return the BMSContainersInquiryQueryObject object itself. + */ + public BMSContainersInquiryQueryObject withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSPOQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSPOQueryObject.java new file mode 100644 index 0000000000000..966ea0a30bea2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSPOQueryObject.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters to list items that can be backed up. + */ +public class BMSPOQueryObject { + /** + * Backup management type. Possible values include: 'Invalid', + * 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Workload type. Possible values include: 'Invalid', 'VM', 'FileFolder', + * 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + * 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + * 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /** + * Full name of the container whose Protectable Objects should be returned. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * Backup status query parameter. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Get backup management type. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSPOQueryObject object itself. + */ + public BMSPOQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get workload type. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workloadType value + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set workload type. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workloadType the workloadType value to set + * @return the BMSPOQueryObject object itself. + */ + public BMSPOQueryObject withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get full name of the container whose Protectable Objects should be returned. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set full name of the container whose Protectable Objects should be returned. + * + * @param containerName the containerName value to set + * @return the BMSPOQueryObject object itself. + */ + public BMSPOQueryObject withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get backup status query parameter. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set 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 friendly name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSRPQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSRPQueryObject.java new file mode 100644 index 0000000000000..639017e4fdf3d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSRPQueryObject.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters to list backup copies. + */ +public class BMSRPQueryObject { + /** + * Backup copies created after this time. + */ + @JsonProperty(value = "startDate") + private DateTime startDate; + + /** + * Backup copies created before this time. + */ + @JsonProperty(value = "endDate") + private DateTime endDate; + + /** + * RestorePoint type. Possible values include: 'Invalid', 'Full', 'Log', + * 'Differential', 'FullAndDifferential', 'All', 'Incremental'. + */ + @JsonProperty(value = "restorePointQueryType") + private RestorePointQueryType restorePointQueryType; + + /** + * In Get Recovery Point, it tells whether extended information about + * recovery point is asked. + */ + @JsonProperty(value = "extendedInfo") + private Boolean extendedInfo; + + /** + * Get backup copies created after this time. + * + * @return the startDate value + */ + public DateTime startDate() { + return this.startDate; + } + + /** + * Set 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 backup copies created before this time. + * + * @return the endDate value + */ + public DateTime endDate() { + return this.endDate; + } + + /** + * Set 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; + } + + /** + * Get restorePoint type. Possible values include: 'Invalid', 'Full', 'Log', 'Differential', 'FullAndDifferential', 'All', 'Incremental'. + * + * @return the restorePointQueryType value + */ + public RestorePointQueryType restorePointQueryType() { + return this.restorePointQueryType; + } + + /** + * Set restorePoint type. Possible values include: 'Invalid', 'Full', 'Log', 'Differential', 'FullAndDifferential', 'All', 'Incremental'. + * + * @param restorePointQueryType the restorePointQueryType value to set + * @return the BMSRPQueryObject object itself. + */ + public BMSRPQueryObject withRestorePointQueryType(RestorePointQueryType restorePointQueryType) { + this.restorePointQueryType = restorePointQueryType; + return this; + } + + /** + * Get in Get Recovery Point, it tells whether extended information about recovery point is asked. + * + * @return the extendedInfo value + */ + public Boolean extendedInfo() { + return this.extendedInfo; + } + + /** + * Set in Get Recovery Point, it tells whether extended information about recovery point is asked. + * + * @param extendedInfo the extendedInfo value to set + * @return the BMSRPQueryObject object itself. + */ + public BMSRPQueryObject withExtendedInfo(Boolean extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSRefreshContainersQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSRefreshContainersQueryObject.java new file mode 100644 index 0000000000000..dd46bb84fe6e8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSRefreshContainersQueryObject.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The query filters that can be used with the refresh container API. + */ +public class BMSRefreshContainersQueryObject { + /** + * Backup management type for this container. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Get backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSRefreshContainersQueryObject object itself. + */ + public BMSRefreshContainersQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSWorkloadItemQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSWorkloadItemQueryObject.java new file mode 100644 index 0000000000000..5002eaba0cedc --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BMSWorkloadItemQueryObject.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters to list items that can be backed up. + */ +public class BMSWorkloadItemQueryObject { + /** + * Backup management type. Possible values include: 'Invalid', + * 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Workload Item type. Possible values include: 'Invalid', 'SQLInstance', + * 'SQLDataBase', 'SAPHanaSystem', 'SAPHanaDatabase', 'SAPAseSystem', + * 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadItemType") + private WorkloadItemType workloadItemType; + + /** + * Workload type. Possible values include: 'Invalid', 'VM', 'FileFolder', + * 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', + * 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + * 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /** + * Backup status query parameter. Possible values include: 'Invalid', + * 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + */ + @JsonProperty(value = "protectionStatus") + private ProtectionStatus protectionStatus; + + /** + * Get backup management type. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSWorkloadItemQueryObject object itself. + */ + public BMSWorkloadItemQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get workload Item type. Possible values include: 'Invalid', 'SQLInstance', 'SQLDataBase', 'SAPHanaSystem', 'SAPHanaDatabase', 'SAPAseSystem', 'SAPAseDatabase'. + * + * @return the workloadItemType value + */ + public WorkloadItemType workloadItemType() { + return this.workloadItemType; + } + + /** + * Set workload Item type. Possible values include: 'Invalid', 'SQLInstance', 'SQLDataBase', 'SAPHanaSystem', 'SAPHanaDatabase', 'SAPAseSystem', 'SAPAseDatabase'. + * + * @param workloadItemType the workloadItemType value to set + * @return the BMSWorkloadItemQueryObject object itself. + */ + public BMSWorkloadItemQueryObject withWorkloadItemType(WorkloadItemType workloadItemType) { + this.workloadItemType = workloadItemType; + return this; + } + + /** + * Get workload type. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workloadType value + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set workload type. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workloadType the workloadType value to set + * @return the BMSWorkloadItemQueryObject object itself. + */ + public BMSWorkloadItemQueryObject withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get backup status query parameter. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @return the protectionStatus value + */ + public ProtectionStatus protectionStatus() { + return this.protectionStatus; + } + + /** + * Set backup status query parameter. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @param protectionStatus the protectionStatus value to set + * @return the BMSWorkloadItemQueryObject object itself. + */ + public BMSWorkloadItemQueryObject withProtectionStatus(ProtectionStatus protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineBase.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineBase.java new file mode 100644 index 0000000000000..85b756db54953 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineBase.java @@ -0,0 +1,346 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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", defaultImpl = BackupEngineBase.class) +@JsonTypeName("BackupEngineBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureBackupServerEngine", value = AzureBackupServerEngine.class), + @JsonSubTypes.Type(name = "DpmBackupEngine", value = DpmBackupEngine.class) +}) +public class BackupEngineBase { + /** + * Friendly name of the backup engine. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Type of backup management for the backup engine. Possible values + * include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', + * 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Registration status of the backup engine with the Recovery Services + * Vault. + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /** + * Status of the backup engine with the Recovery Services Vault. = + * {Active/Deleting/DeleteFailed}. + */ + @JsonProperty(value = "backupEngineState") + private String backupEngineState; + + /** + * Backup status of the backup engine. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /** + * Flag indicating if the backup engine be registered, once already + * registered. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /** + * ID of the backup engine. + */ + @JsonProperty(value = "backupEngineId") + private String backupEngineId; + + /** + * Backup engine version. + */ + @JsonProperty(value = "dpmVersion") + private String dpmVersion; + + /** + * Backup agent version. + */ + @JsonProperty(value = "azureBackupAgentVersion") + private String azureBackupAgentVersion; + + /** + * To check if backup agent upgrade available. + */ + @JsonProperty(value = "isAzureBackupAgentUpgradeAvailable") + private Boolean isAzureBackupAgentUpgradeAvailable; + + /** + * To check if backup engine upgrade available. + */ + @JsonProperty(value = "isDpmUpgradeAvailable") + private Boolean isDpmUpgradeAvailable; + + /** + * Extended info of the backupengine. + */ + @JsonProperty(value = "extendedInfo") + private BackupEngineExtendedInfo extendedInfo; + + /** + * Get friendly name of the backup engine. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set 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 type of backup management for the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management for the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get registration status of the backup engine with the Recovery Services Vault. + * + * @return the registrationStatus value + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set registration status of the backup engine 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 status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed}. + * + * @return the backupEngineState value + */ + public String backupEngineState() { + return this.backupEngineState; + } + + /** + * Set status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed}. + * + * @param backupEngineState the backupEngineState value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withBackupEngineState(String backupEngineState) { + this.backupEngineState = backupEngineState; + return this; + } + + /** + * Get backup status of the backup engine. + * + * @return the healthStatus value + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set 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 flag indicating if the backup engine be registered, once already registered. + * + * @return the canReRegister value + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set flag indicating if the backup engine be registered, once already registered. + * + * @param canReRegister the canReRegister value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withCanReRegister(Boolean canReRegister) { + this.canReRegister = canReRegister; + return this; + } + + /** + * Get iD of the backup engine. + * + * @return the backupEngineId value + */ + public String backupEngineId() { + return this.backupEngineId; + } + + /** + * Set 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; + } + + /** + * Get backup engine version. + * + * @return the dpmVersion value + */ + public String dpmVersion() { + return this.dpmVersion; + } + + /** + * Set backup engine version. + * + * @param dpmVersion the dpmVersion value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withDpmVersion(String dpmVersion) { + this.dpmVersion = dpmVersion; + return this; + } + + /** + * Get backup agent version. + * + * @return the azureBackupAgentVersion value + */ + public String azureBackupAgentVersion() { + return this.azureBackupAgentVersion; + } + + /** + * Set backup agent version. + * + * @param azureBackupAgentVersion the azureBackupAgentVersion value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withAzureBackupAgentVersion(String azureBackupAgentVersion) { + this.azureBackupAgentVersion = azureBackupAgentVersion; + return this; + } + + /** + * Get to check if backup agent upgrade available. + * + * @return the isAzureBackupAgentUpgradeAvailable value + */ + public Boolean isAzureBackupAgentUpgradeAvailable() { + return this.isAzureBackupAgentUpgradeAvailable; + } + + /** + * Set to check if backup agent upgrade available. + * + * @param isAzureBackupAgentUpgradeAvailable the isAzureBackupAgentUpgradeAvailable value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withIsAzureBackupAgentUpgradeAvailable(Boolean isAzureBackupAgentUpgradeAvailable) { + this.isAzureBackupAgentUpgradeAvailable = isAzureBackupAgentUpgradeAvailable; + return this; + } + + /** + * Get to check if backup engine upgrade available. + * + * @return the isDpmUpgradeAvailable value + */ + public Boolean isDpmUpgradeAvailable() { + return this.isDpmUpgradeAvailable; + } + + /** + * Set to check if backup engine upgrade available. + * + * @param isDpmUpgradeAvailable the isDpmUpgradeAvailable value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withIsDpmUpgradeAvailable(Boolean isDpmUpgradeAvailable) { + this.isDpmUpgradeAvailable = isDpmUpgradeAvailable; + return this; + } + + /** + * Get extended info of the backupengine. + * + * @return the extendedInfo value + */ + public BackupEngineExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set extended info of the backupengine. + * + * @param extendedInfo the extendedInfo value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withExtendedInfo(BackupEngineExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineBaseResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineBaseResource.java new file mode 100644 index 0000000000000..303df846160f9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineBaseResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupEngineBaseResourceInner; +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.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing BackupEngineBaseResource. + */ +public interface BackupEngineBaseResource 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. + */ + BackupEngineBase properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineExtendedInfo.java new file mode 100644 index 0000000000000..8ab8e1cc1f299 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngineExtendedInfo.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information on backup engine. + */ +public class BackupEngineExtendedInfo { + /** + * Database name of backup engine. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Number of protected items in the backup engine. + */ + @JsonProperty(value = "protectedItemsCount") + private Integer protectedItemsCount; + + /** + * Number of protected servers in the backup engine. + */ + @JsonProperty(value = "protectedServersCount") + private Integer protectedServersCount; + + /** + * Number of disks in the backup engine. + */ + @JsonProperty(value = "diskCount") + private Integer diskCount; + + /** + * Disk space used in the backup engine. + */ + @JsonProperty(value = "usedDiskSpace") + private Double usedDiskSpace; + + /** + * Disk space currently available in the backup engine. + */ + @JsonProperty(value = "availableDiskSpace") + private Double availableDiskSpace; + + /** + * Last refresh time in the backup engine. + */ + @JsonProperty(value = "refreshedAt") + private DateTime refreshedAt; + + /** + * Protected instances in the backup engine. + */ + @JsonProperty(value = "azureProtectedInstances") + private Integer azureProtectedInstances; + + /** + * Get database name of backup engine. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set database name of backup engine. + * + * @param databaseName the databaseName value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get number of protected items in the backup engine. + * + * @return the protectedItemsCount value + */ + public Integer protectedItemsCount() { + return this.protectedItemsCount; + } + + /** + * Set number of protected items in the backup engine. + * + * @param protectedItemsCount the protectedItemsCount value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withProtectedItemsCount(Integer protectedItemsCount) { + this.protectedItemsCount = protectedItemsCount; + return this; + } + + /** + * Get number of protected servers in the backup engine. + * + * @return the protectedServersCount value + */ + public Integer protectedServersCount() { + return this.protectedServersCount; + } + + /** + * Set number of protected servers in the backup engine. + * + * @param protectedServersCount the protectedServersCount value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withProtectedServersCount(Integer protectedServersCount) { + this.protectedServersCount = protectedServersCount; + return this; + } + + /** + * Get number of disks in the backup engine. + * + * @return the diskCount value + */ + public Integer diskCount() { + return this.diskCount; + } + + /** + * Set number of disks in the backup engine. + * + * @param diskCount the diskCount value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withDiskCount(Integer diskCount) { + this.diskCount = diskCount; + return this; + } + + /** + * Get disk space used in the backup engine. + * + * @return the usedDiskSpace value + */ + public Double usedDiskSpace() { + return this.usedDiskSpace; + } + + /** + * Set disk space used in the backup engine. + * + * @param usedDiskSpace the usedDiskSpace value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withUsedDiskSpace(Double usedDiskSpace) { + this.usedDiskSpace = usedDiskSpace; + return this; + } + + /** + * Get disk space currently available in the backup engine. + * + * @return the availableDiskSpace value + */ + public Double availableDiskSpace() { + return this.availableDiskSpace; + } + + /** + * Set disk space currently available in the backup engine. + * + * @param availableDiskSpace the availableDiskSpace value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withAvailableDiskSpace(Double availableDiskSpace) { + this.availableDiskSpace = availableDiskSpace; + return this; + } + + /** + * Get last refresh time in the backup engine. + * + * @return the refreshedAt value + */ + public DateTime refreshedAt() { + return this.refreshedAt; + } + + /** + * Set last refresh time in the backup engine. + * + * @param refreshedAt the refreshedAt value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withRefreshedAt(DateTime refreshedAt) { + this.refreshedAt = refreshedAt; + return this; + } + + /** + * Get protected instances in the backup engine. + * + * @return the azureProtectedInstances value + */ + public Integer azureProtectedInstances() { + return this.azureProtectedInstances; + } + + /** + * Set protected instances in the backup engine. + * + * @param azureProtectedInstances the azureProtectedInstances value to set + * @return the BackupEngineExtendedInfo object itself. + */ + public BackupEngineExtendedInfo withAzureProtectedInstances(Integer azureProtectedInstances) { + this.azureProtectedInstances = azureProtectedInstances; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngines.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngines.java new file mode 100644 index 0000000000000..f8055dc070e92 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupEngines.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupEnginesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupEngines. + */ +public interface BackupEngines extends HasInner { + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String backupEngineName); + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupFabricVaultOperationStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupFabricVaultOperationStatus.java new file mode 100644 index 0000000000000..a4ff66c009990 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupFabricVaultProtectionContainerResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupFabricVaultProtectionContainerResource.java new file mode 100644 index 0000000000000..cee70bc468911 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupFabricVaultProtectionContainerResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionContainerResourceInner; +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.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * Type representing BackupFabricVaultProtectionContainerResource. + */ +public interface BackupFabricVaultProtectionContainerResource 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. + */ + ProtectionContainerInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BackupFabricVaultProtectionContainerResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBackupFabric, DefinitionStages.WithCreate { + } + + /** + * Grouping of BackupFabricVaultProtectionContainerResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BackupFabricVaultProtectionContainerResource definition. + */ + interface Blank extends WithBackupFabric { + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource definition allowing to specify BackupFabric. + */ + interface WithBackupFabric { + /** + * Specifies vaultName, resourceGroupName, fabricName. + * @param vaultName The name of the recovery services vault + * @param resourceGroupName The name of the resource group where the recovery services vault is present + * @param fabricName Fabric name associated with the container + * @return the next definition stage + */ + WithCreate withExistingBackupFabric(String vaultName, String resourceGroupName, String fabricName); + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource definition allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag Optional ETag + * @return the next definition stage + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties ProtectionContainerResource properties + * @return the next definition stage + */ + WithCreate withProperties(ProtectionContainerInner properties); + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the 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.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithTags { + } + } + /** + * The template for a BackupFabricVaultProtectionContainerResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithETag, UpdateStages.WithLocation, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of BackupFabricVaultProtectionContainerResource update stages. + */ + interface UpdateStages { + /** + * The stage of the backupfabricvaultprotectioncontainerresource update allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag Optional ETag + * @return the next update stage + */ + Update withETag(String eTag); + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties ProtectionContainerResource properties + * @return the next update stage + */ + Update withProperties(ProtectionContainerInner properties); + } + + /** + * The stage of the backupfabricvaultprotectioncontainerresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupItemType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupItemType.java new file mode 100644 index 0000000000000..5f85bda77c119 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupItemType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupItemType. + */ +public final class BackupItemType extends ExpandableStringEnum { + /** Static value Invalid for BackupItemType. */ + public static final BackupItemType INVALID = fromString("Invalid"); + + /** Static value VM for BackupItemType. */ + public static final BackupItemType VM = fromString("VM"); + + /** Static value FileFolder for BackupItemType. */ + public static final BackupItemType FILE_FOLDER = fromString("FileFolder"); + + /** Static value AzureSqlDb for BackupItemType. */ + public static final BackupItemType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** Static value SQLDB for BackupItemType. */ + public static final BackupItemType SQLDB = fromString("SQLDB"); + + /** Static value Exchange for BackupItemType. */ + public static final BackupItemType EXCHANGE = fromString("Exchange"); + + /** Static value Sharepoint for BackupItemType. */ + public static final BackupItemType SHAREPOINT = fromString("Sharepoint"); + + /** Static value VMwareVM for BackupItemType. */ + public static final BackupItemType VMWARE_VM = fromString("VMwareVM"); + + /** Static value SystemState for BackupItemType. */ + public static final BackupItemType SYSTEM_STATE = fromString("SystemState"); + + /** Static value Client for BackupItemType. */ + public static final BackupItemType CLIENT = fromString("Client"); + + /** Static value GenericDataSource for BackupItemType. */ + public static final BackupItemType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** Static value SQLDataBase for BackupItemType. */ + public static final BackupItemType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value AzureFileShare for BackupItemType. */ + public static final BackupItemType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** Static value SAPHanaDatabase for BackupItemType. */ + public static final BackupItemType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseDatabase for BackupItemType. */ + public static final BackupItemType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a BackupItemType from its string representation. + * @param name a name to look for + * @return the corresponding BackupItemType + */ + @JsonCreator + public static BackupItemType fromString(String name) { + return fromString(name, BackupItemType.class); + } + + /** + * @return known BackupItemType values + */ + public static Collection values() { + return values(BackupItemType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupJobs.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupJobs.java new file mode 100644 index 0000000000000..23ff3b6c7ff58 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupJobs.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupJobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupJobs. + */ +public interface BackupJobs 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 where the recovery services vault is present. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupManagementType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupManagementType.java new file mode 100644 index 0000000000000..ef1cdfaf8c92a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupManagementType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BackupManagementType. + */ +public final class BackupManagementType extends ExpandableStringEnum { + /** Static value Invalid for BackupManagementType. */ + public static final BackupManagementType INVALID = fromString("Invalid"); + + /** Static value AzureIaasVM for BackupManagementType. */ + public static final BackupManagementType AZURE_IAAS_VM = fromString("AzureIaasVM"); + + /** Static value MAB for BackupManagementType. */ + public static final BackupManagementType MAB = fromString("MAB"); + + /** Static value DPM for BackupManagementType. */ + public static final BackupManagementType DPM = fromString("DPM"); + + /** Static value AzureBackupServer for BackupManagementType. */ + public static final BackupManagementType AZURE_BACKUP_SERVER = fromString("AzureBackupServer"); + + /** Static value AzureSql for BackupManagementType. */ + public static final BackupManagementType AZURE_SQL = fromString("AzureSql"); + + /** Static value AzureStorage for BackupManagementType. */ + public static final BackupManagementType AZURE_STORAGE = fromString("AzureStorage"); + + /** Static value AzureWorkload for BackupManagementType. */ + public static final BackupManagementType AZURE_WORKLOAD = fromString("AzureWorkload"); + + /** Static value DefaultBackup for BackupManagementType. */ + public static final BackupManagementType DEFAULT_BACKUP = fromString("DefaultBackup"); + + /** + * Creates or finds a BackupManagementType from its string representation. + * @param name a name to look for + * @return the corresponding BackupManagementType + */ + @JsonCreator + public static BackupManagementType fromString(String name) { + return fromString(name, BackupManagementType.class); + } + + /** + * @return known BackupManagementType values + */ + public static Collection values() { + return values(BackupManagementType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupManagementUsage.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupManagementUsage.java new file mode 100644 index 0000000000000..45c41984b6e6c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupManagementUsage.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupManagementUsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import org.joda.time.DateTime; + +/** + * Type representing BackupManagementUsage. + */ +public interface BackupManagementUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Long currentValue(); + + /** + * @return the limit value. + */ + Long limit(); + + /** + * @return the name value. + */ + NameInfo name(); + + /** + * @return the nextResetTime value. + */ + DateTime nextResetTime(); + + /** + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * @return the unit value. + */ + UsagesUnit unit(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupOperationResults.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupOperationResults.java new file mode 100644 index 0000000000000..fa525c34fb617 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupOperationResults.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupOperationResults. + */ +public interface BackupOperationResults extends HasInner { + /** + * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the + status code in the response would be Accepted. It will continue to be in this state till it reaches completion. On + successful completion, the status code will be 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupOperationStatuses.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupOperationStatuses.java new file mode 100644 index 0000000000000..6c5a09fc50467 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupOperationStatuses.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupOperationStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupOperationStatuses. + */ +public interface BackupOperationStatuses extends HasInner { + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupPolicyVaultOperationStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupPolicyVaultOperationStatus.java new file mode 100644 index 0000000000000..a7567a66bdd9b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectableItems.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectableItems.java new file mode 100644 index 0000000000000..0247c666f1415 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectableItems.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupProtectableItemsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupProtectableItems. + */ +public interface BackupProtectableItems extends HasInner { + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectedItems.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectedItems.java new file mode 100644 index 0000000000000..93a3d81bc7cd4 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectedItems.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupProtectedItemsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupProtectedItems. + */ +public interface BackupProtectedItems extends HasInner { + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectionContainers.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectionContainers.java new file mode 100644 index 0000000000000..400001271c6b6 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectionContainers.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupProtectionContainersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupProtectionContainers. + */ +public interface BackupProtectionContainers extends HasInner { + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectionIntents.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectionIntents.java new file mode 100644 index 0000000000000..d617e978ea392 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupProtectionIntents.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupProtectionIntentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupProtectionIntents. + */ +public interface BackupProtectionIntents extends HasInner { + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupRequest.java new file mode 100644 index 0000000000000..e3703d28e2a02 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for backup request. Workload-specific backup requests are derived + * from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = BackupRequest.class) +@JsonTypeName("BackupRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareBackupRequest", value = AzureFileShareBackupRequest.class), + @JsonSubTypes.Type(name = "IaasVMBackupRequest", value = IaasVMBackupRequest.class) +}) +public class BackupRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupRequestResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupRequestResource.java new file mode 100644 index 0000000000000..8ec290f349f05 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupRequestResource.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for backup request. Workload-specific backup requests are derived + * from this class. + */ +@SkipParentValidation +public class BackupRequestResource extends Resource { + /** + * BackupRequestResource properties. + */ + @JsonProperty(value = "properties") + private BackupRequest properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get backupRequestResource properties. + * + * @return the properties value + */ + public BackupRequest properties() { + return this.properties; + } + + /** + * Set backupRequestResource properties. + * + * @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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupResourceVaultConfigResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupResourceVaultConfigResource.java new file mode 100644 index 0000000000000..f118093ada8b8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupResourceVaultConfigResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupResourceVaultConfigResourceInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupResourceVaultConfigInner; +import java.util.Map; + +/** + * Type representing BackupResourceVaultConfigResource. + */ +public interface BackupResourceVaultConfigResource 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. + */ + BackupResourceVaultConfigInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupResourceVaultConfigs.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupResourceVaultConfigs.java new file mode 100644 index 0000000000000..6b4945ac0c4bd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupResourceVaultConfigs.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupResourceVaultConfigResourceInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupResourceVaultConfigsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupResourceVaultConfigs. + */ +public interface BackupResourceVaultConfigs extends HasInner { + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters); + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable putAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatus.java new file mode 100644 index 0000000000000..d236c94bd1bee --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupStatusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupStatus. + */ +public interface BackupStatus extends HasInner { + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api + * @param parameters Container Backup Status Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String azureRegion, BackupStatusRequest parameters); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatusRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatusRequest.java new file mode 100644 index 0000000000000..c5bd9abf187d6 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatusRequest.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BackupStatus request. + */ +public class BackupStatusRequest { + /** + * Container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values + * include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + * 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + * 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', + * 'SAPAseDatabase'. + */ + @JsonProperty(value = "resourceType") + private DataSourceType resourceType; + + /** + * Entire ARM resource id of the resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Protectable Item Logical Name. + */ + @JsonProperty(value = "poLogicalName") + private String poLogicalName; + + /** + * Get container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the resourceType value + */ + public DataSourceType resourceType() { + return this.resourceType; + } + + /** + * Set container Type - VM, SQLPaaS, DPM, AzureFileShare. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param resourceType the resourceType value to set + * @return the BackupStatusRequest object itself. + */ + public BackupStatusRequest withResourceType(DataSourceType resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get entire ARM resource id of the resource. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set entire ARM resource id of the resource. + * + * @param resourceId the resourceId value to set + * @return the BackupStatusRequest object itself. + */ + public BackupStatusRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get protectable Item Logical Name. + * + * @return the poLogicalName value + */ + public String poLogicalName() { + return this.poLogicalName; + } + + /** + * Set protectable Item Logical Name. + * + * @param poLogicalName the poLogicalName value to set + * @return the BackupStatusRequest object itself. + */ + public BackupStatusRequest withPoLogicalName(String poLogicalName) { + this.poLogicalName = poLogicalName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatusResponse.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatusResponse.java new file mode 100644 index 0000000000000..18a63f37b3d0a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupStatusResponse.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupStatusResponseInner; + +/** + * Type representing BackupStatusResponse. + */ +public interface BackupStatusResponse extends HasInner, HasManager { + /** + * @return the containerName value. + */ + String containerName(); + + /** + * @return the errorCode value. + */ + String errorCode(); + + /** + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * @return the fabricName value. + */ + FabricName fabricName(); + + /** + * @return the policyName value. + */ + String policyName(); + + /** + * @return the protectedItemName value. + */ + String protectedItemName(); + + /** + * @return the protectionStatus value. + */ + ProtectionStatus protectionStatus(); + + /** + * @return the registrationStatus value. + */ + String registrationStatus(); + + /** + * @return the vaultId value. + */ + String vaultId(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupUsageSummaries.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupUsageSummaries.java new file mode 100644 index 0000000000000..536abb48984a1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupUsageSummaries.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupUsageSummariesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupUsageSummaries. + */ +public interface BackupUsageSummaries extends HasInner { + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String vaultName, String resourceGroupName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupWorkloadItems.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupWorkloadItems.java new file mode 100644 index 0000000000000..6672d37080a8a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/BackupWorkloadItems.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.BackupWorkloadItemsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupWorkloadItems. + */ +public interface BackupWorkloadItems extends HasInner { + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryDisplay.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryDisplay.java new file mode 100644 index 0000000000000..c638bcbcaaad9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryDisplay.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display information of an operation. + */ +public class ClientDiscoveryDisplay { + /** + * Name of the provider for display purposes. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * ResourceType for which this Operation can be performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operations Name itself. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation having details of what operation is about. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the provider for display purposes. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set name of the provider for display purposes. + * + * @param provider the provider value to set + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resourceType for which this Operation can be performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resourceType for which this Operation can be performed. + * + * @param resource the resource value to set + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operations Name itself. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operations Name itself. + * + * @param operation the operation value to set + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation having details of what operation is about. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation having details of what operation is about. + * + * @param description the description value to set + * @return the ClientDiscoveryDisplay object itself. + */ + public ClientDiscoveryDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForLogSpecification.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForLogSpecification.java new file mode 100644 index 0000000000000..8028823370b1c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForLogSpecification.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to represent shoebox log specification in json client discovery. + */ +public class ClientDiscoveryForLogSpecification { + /** + * Name for shoebox log specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * blob duration of shoebox log specification. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get name for shoebox log specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name for shoebox log specification. + * + * @param name the name value to set + * @return the ClientDiscoveryForLogSpecification object itself. + */ + public ClientDiscoveryForLogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized display name. + * + * @param displayName the displayName value to set + * @return the ClientDiscoveryForLogSpecification object itself. + */ + public ClientDiscoveryForLogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get blob duration of shoebox log specification. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set blob duration of shoebox log specification. + * + * @param blobDuration the blobDuration value to set + * @return the ClientDiscoveryForLogSpecification object itself. + */ + public ClientDiscoveryForLogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForProperties.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForProperties.java new file mode 100644 index 0000000000000..ecf26ba55307e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForProperties.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to represent shoebox properties in json client discovery. + */ +public class ClientDiscoveryForProperties { + /** + * Operation properties. + */ + @JsonProperty(value = "serviceSpecification") + private ClientDiscoveryForServiceSpecification serviceSpecification; + + /** + * Get operation properties. + * + * @return the serviceSpecification value + */ + public ClientDiscoveryForServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set operation properties. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the ClientDiscoveryForProperties object itself. + */ + public ClientDiscoveryForProperties withServiceSpecification(ClientDiscoveryForServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForServiceSpecification.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForServiceSpecification.java new file mode 100644 index 0000000000000..8268b66effc9d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryForServiceSpecification.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to represent shoebox service specification in json client discovery. + */ +public class ClientDiscoveryForServiceSpecification { + /** + * List of log specifications of this operation. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get list of log specifications of this operation. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set list of log specifications of this operation. + * + * @param logSpecifications the logSpecifications value to set + * @return the ClientDiscoveryForServiceSpecification object itself. + */ + public ClientDiscoveryForServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryValueForSingleApi.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryValueForSingleApi.java new file mode 100644 index 0000000000000..3c86c35e968f0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientDiscoveryValueForSingleApi.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ClientDiscoveryValueForSingleApiInner; + +/** + * Type representing ClientDiscoveryValueForSingleApi. + */ +public interface ClientDiscoveryValueForSingleApi extends HasInner, HasManager { + /** + * @return the display value. + */ + ClientDiscoveryDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + ClientDiscoveryForProperties properties(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientScriptForConnect.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientScriptForConnect.java new file mode 100644 index 0000000000000..6f5cca1abc0eb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ClientScriptForConnect.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Client script details for file / folder restore. + */ +public class ClientScriptForConnect { + /** + * File content of the client script for file / folder restore. + */ + @JsonProperty(value = "scriptContent") + private String scriptContent; + + /** + * File extension of the client script for file / folder restore - .ps1 , + * .sh , etc. + */ + @JsonProperty(value = "scriptExtension") + private String scriptExtension; + + /** + * OS type - Windows, Linux etc. for which this file / folder restore + * client script works. + */ + @JsonProperty(value = "osType") + private String osType; + + /** + * URL of Executable from where to source the content. If this is not null + * then ScriptContent should not be used. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Mandatory suffix that should be added to the name of script that is + * given for download to user. + * If its null or empty then , ignore it. + */ + @JsonProperty(value = "scriptNameSuffix") + private String scriptNameSuffix; + + /** + * Get file content of the client script for file / folder restore. + * + * @return the scriptContent value + */ + public String scriptContent() { + return this.scriptContent; + } + + /** + * Set file content of the client script for file / 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 file / folder restore - .ps1 , .sh , etc. + * + * @return the scriptExtension value + */ + public String scriptExtension() { + return this.scriptExtension; + } + + /** + * Set file extension of the client script for file / folder restore - .ps1 , .sh , etc. + * + * @param scriptExtension the scriptExtension value to set + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withScriptExtension(String scriptExtension) { + this.scriptExtension = scriptExtension; + return this; + } + + /** + * Get oS type - Windows, Linux etc. for which this file / folder restore client script works. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set oS type - Windows, Linux etc. for which this file / 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; + } + + /** + * Get uRL of Executable from where to source the content. If this is not null then ScriptContent should not be used. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set uRL of Executable from where to source the content. If this is not null then ScriptContent should not be used. + * + * @param url the url value to set + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get mandatory suffix that should be added to the name of script that is given for download to user. + If its null or empty then , ignore it. + * + * @return the scriptNameSuffix value + */ + public String scriptNameSuffix() { + return this.scriptNameSuffix; + } + + /** + * Set mandatory suffix that should be added to the name of script that is given for download to user. + If its null or empty then , ignore it. + * + * @param scriptNameSuffix the scriptNameSuffix value to set + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withScriptNameSuffix(String scriptNameSuffix) { + this.scriptNameSuffix = scriptNameSuffix; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ContainerIdentityInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ContainerIdentityInfo.java new file mode 100644 index 0000000000000..f2bec2735dd69 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ContainerIdentityInfo.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container identity information. + */ +public class ContainerIdentityInfo { + /** + * Unique name of the container. + */ + @JsonProperty(value = "uniqueName") + private String uniqueName; + + /** + * Protection container identity - AAD Tenant. + */ + @JsonProperty(value = "aadTenantId") + private String aadTenantId; + + /** + * Protection container identity - AAD Service Principal. + */ + @JsonProperty(value = "servicePrincipalClientId") + private String servicePrincipalClientId; + + /** + * Protection container identity - Audience. + */ + @JsonProperty(value = "audience") + private String audience; + + /** + * Get unique name of the container. + * + * @return the uniqueName value + */ + public String uniqueName() { + return this.uniqueName; + } + + /** + * Set unique name of the container. + * + * @param uniqueName the uniqueName value to set + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withUniqueName(String uniqueName) { + this.uniqueName = uniqueName; + return this; + } + + /** + * Get protection container identity - AAD Tenant. + * + * @return the aadTenantId value + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set protection container identity - AAD Tenant. + * + * @param aadTenantId the aadTenantId value to set + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get protection container identity - AAD Service Principal. + * + * @return the servicePrincipalClientId value + */ + public String servicePrincipalClientId() { + return this.servicePrincipalClientId; + } + + /** + * Set protection container identity - AAD Service Principal. + * + * @param servicePrincipalClientId the servicePrincipalClientId value to set + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withServicePrincipalClientId(String servicePrincipalClientId) { + this.servicePrincipalClientId = servicePrincipalClientId; + return this; + } + + /** + * Get protection container identity - Audience. + * + * @return the audience value + */ + public String audience() { + return this.audience; + } + + /** + * Set protection container identity - Audience. + * + * @param audience the audience value to set + * @return the ContainerIdentityInfo object itself. + */ + public ContainerIdentityInfo withAudience(String audience) { + this.audience = audience; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ContainerType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ContainerType.java new file mode 100644 index 0000000000000..1c71d403e4582 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ContainerType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerType. + */ +public final class ContainerType extends ExpandableStringEnum { + /** Static value Invalid for ContainerType. */ + public static final ContainerType INVALID = fromString("Invalid"); + + /** Static value Unknown for ContainerType. */ + public static final ContainerType UNKNOWN = fromString("Unknown"); + + /** Static value IaasVMContainer for ContainerType. */ + public static final ContainerType IAAS_VMCONTAINER = fromString("IaasVMContainer"); + + /** Static value IaasVMServiceContainer for ContainerType. */ + public static final ContainerType IAAS_VMSERVICE_CONTAINER = fromString("IaasVMServiceContainer"); + + /** Static value DPMContainer for ContainerType. */ + public static final ContainerType DPMCONTAINER = fromString("DPMContainer"); + + /** Static value AzureBackupServerContainer for ContainerType. */ + public static final ContainerType AZURE_BACKUP_SERVER_CONTAINER = fromString("AzureBackupServerContainer"); + + /** Static value MABContainer for ContainerType. */ + public static final ContainerType MABCONTAINER = fromString("MABContainer"); + + /** Static value Cluster for ContainerType. */ + public static final ContainerType CLUSTER = fromString("Cluster"); + + /** Static value AzureSqlContainer for ContainerType. */ + public static final ContainerType AZURE_SQL_CONTAINER = fromString("AzureSqlContainer"); + + /** Static value Windows for ContainerType. */ + public static final ContainerType WINDOWS = fromString("Windows"); + + /** Static value VCenter for ContainerType. */ + public static final ContainerType VCENTER = fromString("VCenter"); + + /** Static value VMAppContainer for ContainerType. */ + public static final ContainerType VMAPP_CONTAINER = fromString("VMAppContainer"); + + /** Static value SQLAGWorkLoadContainer for ContainerType. */ + public static final ContainerType SQLAGWORK_LOAD_CONTAINER = fromString("SQLAGWorkLoadContainer"); + + /** Static value StorageContainer for ContainerType. */ + public static final ContainerType STORAGE_CONTAINER = fromString("StorageContainer"); + + /** Static value GenericContainer for ContainerType. */ + public static final ContainerType GENERIC_CONTAINER = fromString("GenericContainer"); + + /** + * Creates or finds a ContainerType from its string representation. + * @param name a name to look for + * @return the corresponding ContainerType + */ + @JsonCreator + public static ContainerType fromString(String name) { + return fromString(name, ContainerType.class); + } + + /** + * @return known ContainerType values + */ + public static Collection values() { + return values(ContainerType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/CopyOptions.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/CopyOptions.java new file mode 100644 index 0000000000000..8518177e61116 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/CopyOptions.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CopyOptions. + */ +public final class CopyOptions extends ExpandableStringEnum { + /** Static value Invalid for CopyOptions. */ + public static final CopyOptions INVALID = fromString("Invalid"); + + /** Static value CreateCopy for CopyOptions. */ + public static final CopyOptions CREATE_COPY = fromString("CreateCopy"); + + /** Static value Skip for CopyOptions. */ + public static final CopyOptions SKIP = fromString("Skip"); + + /** Static value Overwrite for CopyOptions. */ + public static final CopyOptions OVERWRITE = fromString("Overwrite"); + + /** Static value FailOnConflict for CopyOptions. */ + public static final CopyOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); + + /** + * Creates or finds a CopyOptions from its string representation. + * @param name a name to look for + * @return the corresponding CopyOptions + */ + @JsonCreator + public static CopyOptions fromString(String name) { + return fromString(name, CopyOptions.class); + } + + /** + * @return known CopyOptions values + */ + public static Collection values() { + return values(CopyOptions.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/CreateMode.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/CreateMode.java new file mode 100644 index 0000000000000..8474e4ab58dbb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/CreateMode.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CreateMode. + */ +public final class CreateMode extends ExpandableStringEnum { + /** Static value Invalid for CreateMode. */ + public static final CreateMode INVALID = fromString("Invalid"); + + /** Static value Default for CreateMode. */ + public static final CreateMode DEFAULT = fromString("Default"); + + /** Static value Recover for CreateMode. */ + public static final CreateMode RECOVER = fromString("Recover"); + + /** + * Creates or finds a CreateMode from its string representation. + * @param name a name to look for + * @return the corresponding CreateMode + */ + @JsonCreator + public static CreateMode fromString(String name) { + return fromString(name, CreateMode.class); + } + + /** + * @return known CreateMode values + */ + public static Collection values() { + return values(CreateMode.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMContainerExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMContainerExtendedInfo.java new file mode 100644 index 0000000000000..296a0e6209fae --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMContainerExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information of the DPMContainer. + */ +public class DPMContainerExtendedInfo { + /** + * Last refresh time of the DPMContainer. + */ + @JsonProperty(value = "lastRefreshedAt") + private DateTime lastRefreshedAt; + + /** + * Get last refresh time of the DPMContainer. + * + * @return the lastRefreshedAt value + */ + public DateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set last refresh time of the DPMContainer. + * + * @param lastRefreshedAt the lastRefreshedAt value to set + * @return the DPMContainerExtendedInfo object itself. + */ + public DPMContainerExtendedInfo withLastRefreshedAt(DateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMProtectedItem.java new file mode 100644 index 0000000000000..3b85bd379da52 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMProtectedItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Additional information on Backup engine specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = DPMProtectedItem.class) +@JsonTypeName("DPMProtectedItem") +public class DPMProtectedItem extends ProtectedItem { + /** + * Friendly name of the managed item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Backup Management server protecting this backup item. + */ + @JsonProperty(value = "backupEngineName") + private String backupEngineName; + + /** + * Protection state of the backup engine. Possible values include: + * 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + * 'ProtectionStopped', 'ProtectionPaused'. + */ + @JsonProperty(value = "protectionState") + private ProtectedItemState protectionState; + + /** + * Extended info of the backup item. + */ + @JsonProperty(value = "extendedInfo") + private DPMProtectedItemExtendedInfo extendedInfo; + + /** + * Get friendly name of the managed item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the managed item. + * + * @param friendlyName the friendlyName value to set + * @return the DPMProtectedItem object itself. + */ + public DPMProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get backup Management server protecting this backup item. + * + * @return the backupEngineName value + */ + public String backupEngineName() { + return this.backupEngineName; + } + + /** + * Set backup Management server protecting this backup item. + * + * @param backupEngineName the backupEngineName value to set + * @return the DPMProtectedItem object itself. + */ + public DPMProtectedItem withBackupEngineName(String backupEngineName) { + this.backupEngineName = backupEngineName; + return this; + } + + /** + * Get protection state of the backup engine. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @return the protectionState value + */ + public ProtectedItemState protectionState() { + return this.protectionState; + } + + /** + * Set protection state of the backup engine. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @param protectionState the protectionState value to set + * @return the DPMProtectedItem object itself. + */ + public DPMProtectedItem withProtectionState(ProtectedItemState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get extended info of the backup item. + * + * @return the extendedInfo value + */ + public DPMProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set extended info of the backup item. + * + * @param extendedInfo the extendedInfo value to set + * @return the DPMProtectedItem object itself. + */ + public DPMProtectedItem withExtendedInfo(DPMProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMProtectedItemExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..fd8d25314618a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DPMProtectedItemExtendedInfo.java @@ -0,0 +1,385 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Map; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information of DPM Protected item. + */ +public class DPMProtectedItemExtendedInfo { + /** + * Attribute to provide information on various DBs. + */ + @JsonProperty(value = "protectableObjectLoadPath") + private Map protectableObjectLoadPath; + + /** + * To check if backup item is disk protected. + */ + @JsonProperty(value = "protected") + private Boolean protectedProperty; + + /** + * To check if backup item is cloud protected. + */ + @JsonProperty(value = "isPresentOnCloud") + private Boolean isPresentOnCloud; + + /** + * Last backup status information on backup item. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * Last refresh time on backup item. + */ + @JsonProperty(value = "lastRefreshedAt") + private DateTime lastRefreshedAt; + + /** + * Oldest cloud recovery point time. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * cloud recovery point count. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Oldest disk recovery point time. + */ + @JsonProperty(value = "onPremiseOldestRecoveryPoint") + private DateTime onPremiseOldestRecoveryPoint; + + /** + * latest disk recovery point time. + */ + @JsonProperty(value = "onPremiseLatestRecoveryPoint") + private DateTime onPremiseLatestRecoveryPoint; + + /** + * disk recovery point count. + */ + @JsonProperty(value = "onPremiseRecoveryPointCount") + private Integer onPremiseRecoveryPointCount; + + /** + * To check if backup item is collocated. + */ + @JsonProperty(value = "isCollocated") + private Boolean isCollocated; + + /** + * Protection group name of the backup item. + */ + @JsonProperty(value = "protectionGroupName") + private String protectionGroupName; + + /** + * Used Disk storage in bytes. + */ + @JsonProperty(value = "diskStorageUsedInBytes") + private String diskStorageUsedInBytes; + + /** + * total Disk storage in bytes. + */ + @JsonProperty(value = "totalDiskStorageSizeInBytes") + private String totalDiskStorageSizeInBytes; + + /** + * Get attribute to provide information on various DBs. + * + * @return the protectableObjectLoadPath value + */ + public Map protectableObjectLoadPath() { + return this.protectableObjectLoadPath; + } + + /** + * Set attribute to provide information on various DBs. + * + * @param protectableObjectLoadPath the protectableObjectLoadPath value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withProtectableObjectLoadPath(Map protectableObjectLoadPath) { + this.protectableObjectLoadPath = protectableObjectLoadPath; + return this; + } + + /** + * Get to check if backup item is disk protected. + * + * @return the protectedProperty value + */ + public Boolean protectedProperty() { + return this.protectedProperty; + } + + /** + * Set to check if backup item is disk protected. + * + * @param protectedProperty the protectedProperty value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withProtectedProperty(Boolean protectedProperty) { + this.protectedProperty = protectedProperty; + return this; + } + + /** + * Get to check if backup item is cloud protected. + * + * @return the isPresentOnCloud value + */ + public Boolean isPresentOnCloud() { + return this.isPresentOnCloud; + } + + /** + * Set to check if backup item is cloud protected. + * + * @param isPresentOnCloud the isPresentOnCloud value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withIsPresentOnCloud(Boolean isPresentOnCloud) { + this.isPresentOnCloud = isPresentOnCloud; + return this; + } + + /** + * Get last backup status information on backup item. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set last backup status information on backup item. + * + * @param lastBackupStatus the lastBackupStatus value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get last refresh time on backup item. + * + * @return the lastRefreshedAt value + */ + public DateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set last refresh time on backup item. + * + * @param lastRefreshedAt the lastRefreshedAt value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withLastRefreshedAt(DateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + + /** + * Get oldest cloud recovery point time. + * + * @return the oldestRecoveryPoint value + */ + public DateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set oldest cloud recovery point time. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withOldestRecoveryPoint(DateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get cloud recovery point count. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set cloud recovery point count. + * + * @param recoveryPointCount the recoveryPointCount value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get oldest disk recovery point time. + * + * @return the onPremiseOldestRecoveryPoint value + */ + public DateTime onPremiseOldestRecoveryPoint() { + return this.onPremiseOldestRecoveryPoint; + } + + /** + * Set oldest disk recovery point time. + * + * @param onPremiseOldestRecoveryPoint the onPremiseOldestRecoveryPoint value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withOnPremiseOldestRecoveryPoint(DateTime onPremiseOldestRecoveryPoint) { + this.onPremiseOldestRecoveryPoint = onPremiseOldestRecoveryPoint; + return this; + } + + /** + * Get latest disk recovery point time. + * + * @return the onPremiseLatestRecoveryPoint value + */ + public DateTime onPremiseLatestRecoveryPoint() { + return this.onPremiseLatestRecoveryPoint; + } + + /** + * Set latest disk recovery point time. + * + * @param onPremiseLatestRecoveryPoint the onPremiseLatestRecoveryPoint value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withOnPremiseLatestRecoveryPoint(DateTime onPremiseLatestRecoveryPoint) { + this.onPremiseLatestRecoveryPoint = onPremiseLatestRecoveryPoint; + return this; + } + + /** + * Get disk recovery point count. + * + * @return the onPremiseRecoveryPointCount value + */ + public Integer onPremiseRecoveryPointCount() { + return this.onPremiseRecoveryPointCount; + } + + /** + * Set disk recovery point count. + * + * @param onPremiseRecoveryPointCount the onPremiseRecoveryPointCount value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withOnPremiseRecoveryPointCount(Integer onPremiseRecoveryPointCount) { + this.onPremiseRecoveryPointCount = onPremiseRecoveryPointCount; + return this; + } + + /** + * Get to check if backup item is collocated. + * + * @return the isCollocated value + */ + public Boolean isCollocated() { + return this.isCollocated; + } + + /** + * Set to check if backup item is collocated. + * + * @param isCollocated the isCollocated value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withIsCollocated(Boolean isCollocated) { + this.isCollocated = isCollocated; + return this; + } + + /** + * Get protection group name of the backup item. + * + * @return the protectionGroupName value + */ + public String protectionGroupName() { + return this.protectionGroupName; + } + + /** + * Set protection group name of the backup item. + * + * @param protectionGroupName the protectionGroupName value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withProtectionGroupName(String protectionGroupName) { + this.protectionGroupName = protectionGroupName; + return this; + } + + /** + * Get used Disk storage in bytes. + * + * @return the diskStorageUsedInBytes value + */ + public String diskStorageUsedInBytes() { + return this.diskStorageUsedInBytes; + } + + /** + * Set used Disk storage in bytes. + * + * @param diskStorageUsedInBytes the diskStorageUsedInBytes value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withDiskStorageUsedInBytes(String diskStorageUsedInBytes) { + this.diskStorageUsedInBytes = diskStorageUsedInBytes; + return this; + } + + /** + * Get total Disk storage in bytes. + * + * @return the totalDiskStorageSizeInBytes value + */ + public String totalDiskStorageSizeInBytes() { + return this.totalDiskStorageSizeInBytes; + } + + /** + * Set total Disk storage in bytes. + * + * @param totalDiskStorageSizeInBytes the totalDiskStorageSizeInBytes value to set + * @return the DPMProtectedItemExtendedInfo object itself. + */ + public DPMProtectedItemExtendedInfo withTotalDiskStorageSizeInBytes(String totalDiskStorageSizeInBytes) { + this.totalDiskStorageSizeInBytes = totalDiskStorageSizeInBytes; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DailyRetentionFormat.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DailyRetentionFormat.java new file mode 100644 index 0000000000000..fb4b684421533 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DailyRetentionSchedule.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DailyRetentionSchedule.java new file mode 100644 index 0000000000000..ff29280711e1a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Daily retention schedule. + */ +public class DailyRetentionSchedule { + /** + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * Retention duration of retention Policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get retention times of retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set 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 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 DailyRetentionSchedule object itself. + */ + public DailyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DataSourceType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DataSourceType.java new file mode 100644 index 0000000000000..c0724c4a24b1e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DataSourceType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataSourceType. + */ +public final class DataSourceType extends ExpandableStringEnum { + /** Static value Invalid for DataSourceType. */ + public static final DataSourceType INVALID = fromString("Invalid"); + + /** Static value VM for DataSourceType. */ + public static final DataSourceType VM = fromString("VM"); + + /** Static value FileFolder for DataSourceType. */ + public static final DataSourceType FILE_FOLDER = fromString("FileFolder"); + + /** Static value AzureSqlDb for DataSourceType. */ + public static final DataSourceType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** Static value SQLDB for DataSourceType. */ + public static final DataSourceType SQLDB = fromString("SQLDB"); + + /** Static value Exchange for DataSourceType. */ + public static final DataSourceType EXCHANGE = fromString("Exchange"); + + /** Static value Sharepoint for DataSourceType. */ + public static final DataSourceType SHAREPOINT = fromString("Sharepoint"); + + /** Static value VMwareVM for DataSourceType. */ + public static final DataSourceType VMWARE_VM = fromString("VMwareVM"); + + /** Static value SystemState for DataSourceType. */ + public static final DataSourceType SYSTEM_STATE = fromString("SystemState"); + + /** Static value Client for DataSourceType. */ + public static final DataSourceType CLIENT = fromString("Client"); + + /** Static value GenericDataSource for DataSourceType. */ + public static final DataSourceType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** Static value SQLDataBase for DataSourceType. */ + public static final DataSourceType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value AzureFileShare for DataSourceType. */ + public static final DataSourceType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** Static value SAPHanaDatabase for DataSourceType. */ + public static final DataSourceType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseDatabase for DataSourceType. */ + public static final DataSourceType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a DataSourceType from its string representation. + * @param name a name to look for + * @return the corresponding DataSourceType + */ + @JsonCreator + public static DataSourceType fromString(String name) { + return fromString(name, DataSourceType.class); + } + + /** + * @return known DataSourceType values + */ + public static Collection values() { + return values(DataSourceType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Day.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Day.java new file mode 100644 index 0000000000000..f01a55383c5aa --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Day of the week. + */ +public class Day { + /** + * Date of the month. + */ + @JsonProperty(value = "date") + private Integer dateProperty; + + /** + * Whether Date is last date of month. + */ + @JsonProperty(value = "isLast") + private Boolean isLast; + + /** + * Get date of the month. + * + * @return the dateProperty value + */ + public Integer dateProperty() { + return this.dateProperty; + } + + /** + * Set date of the month. + * + * @param dateProperty the dateProperty value to set + * @return the Day object itself. + */ + public Day withDateProperty(Integer dateProperty) { + this.dateProperty = dateProperty; + return this; + } + + /** + * Get whether Date is last date of month. + * + * @return the isLast value + */ + public Boolean isLast() { + return this.isLast; + } + + /** + * Set whether Date is last date of month. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DayOfWeek.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DayOfWeek.java new file mode 100644 index 0000000000000..577d308cc11ab --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DiskExclusionProperties.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DiskExclusionProperties.java new file mode 100644 index 0000000000000..5c736ff50a69e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DiskExclusionProperties.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DiskExclusionProperties model. + */ +public class DiskExclusionProperties { + /** + * List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + */ + @JsonProperty(value = "diskLunList") + private List diskLunList; + + /** + * Flag to indicate whether DiskLunList is to be included/ excluded from + * backup. + */ + @JsonProperty(value = "isInclusionList") + private Boolean isInclusionList; + + /** + * Get list of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + * + * @return the diskLunList value + */ + public List diskLunList() { + return this.diskLunList; + } + + /** + * Set list of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + * + * @param diskLunList the diskLunList value to set + * @return the DiskExclusionProperties object itself. + */ + public DiskExclusionProperties withDiskLunList(List diskLunList) { + this.diskLunList = diskLunList; + return this; + } + + /** + * Get flag to indicate whether DiskLunList is to be included/ excluded from backup. + * + * @return the isInclusionList value + */ + public Boolean isInclusionList() { + return this.isInclusionList; + } + + /** + * Set flag to indicate whether DiskLunList is to be included/ excluded from backup. + * + * @param isInclusionList the isInclusionList value to set + * @return the DiskExclusionProperties object itself. + */ + public DiskExclusionProperties withIsInclusionList(Boolean isInclusionList) { + this.isInclusionList = isInclusionList; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DiskInformation.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DiskInformation.java new file mode 100644 index 0000000000000..07e03367f68bb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DiskInformation.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Disk information. + */ +public class DiskInformation { + /** + * The lun property. + */ + @JsonProperty(value = "lun") + private Integer lun; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the lun value. + * + * @return the lun value + */ + public Integer lun() { + return this.lun; + } + + /** + * Set the lun value. + * + * @param lun the lun value to set + * @return the DiskInformation object itself. + */ + public DiskInformation withLun(Integer lun) { + this.lun = lun; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the DiskInformation object itself. + */ + public DiskInformation withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DistributedNodesInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DistributedNodesInfo.java new file mode 100644 index 0000000000000..ca45e43babf6e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DistributedNodesInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is used to represent the various nodes of the distributed container. + */ +public class DistributedNodesInfo { + /** + * Name of the node under a distributed container. + */ + @JsonProperty(value = "nodeName") + private String nodeName; + + /** + * Status of this Node. + * Failed | Succeeded. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Error Details if the Status is non-success. + */ + @JsonProperty(value = "errorDetail") + private ErrorDetail errorDetail; + + /** + * Get name of the node under a distributed container. + * + * @return the nodeName value + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set name of the node under a distributed container. + * + * @param nodeName the nodeName value to set + * @return the DistributedNodesInfo object itself. + */ + public DistributedNodesInfo withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get status of this Node. + Failed | Succeeded. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of this Node. + Failed | Succeeded. + * + * @param status the status value to set + * @return the DistributedNodesInfo object itself. + */ + public DistributedNodesInfo withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get error Details if the Status is non-success. + * + * @return the errorDetail value + */ + public ErrorDetail errorDetail() { + return this.errorDetail; + } + + /** + * Set error Details if the Status is non-success. + * + * @param errorDetail the errorDetail value to set + * @return the DistributedNodesInfo object itself. + */ + public DistributedNodesInfo withErrorDetail(ErrorDetail errorDetail) { + this.errorDetail = errorDetail; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmBackupEngine.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmBackupEngine.java new file mode 100644 index 0000000000000..39c68f1e9d420 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmBackupEngine.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Data Protection Manager (DPM) specific backup engine. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType", defaultImpl = DpmBackupEngine.class) +@JsonTypeName("DpmBackupEngine") +public class DpmBackupEngine extends BackupEngineBase { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmContainer.java new file mode 100644 index 0000000000000..d7caad183f3aa --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmContainer.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * DPM workload-specific protection container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = DpmContainer.class) +@JsonTypeName("DPMContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureBackupServerContainer", value = AzureBackupServerContainer.class) +}) +public class DpmContainer extends ProtectionContainerInner { + /** + * Specifies whether the container is re-registrable. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /** + * ID of container. + */ + @JsonProperty(value = "containerId") + private String containerId; + + /** + * Number of protected items in the BackupEngine. + */ + @JsonProperty(value = "protectedItemCount") + private Long protectedItemCount; + + /** + * Backup engine Agent version. + */ + @JsonProperty(value = "dpmAgentVersion") + private String dpmAgentVersion; + + /** + * List of BackupEngines protecting the container. + */ + @JsonProperty(value = "dpmServers") + private List dpmServers; + + /** + * To check if upgrade available. + */ + @JsonProperty(value = "upgradeAvailable") + private Boolean upgradeAvailable; + + /** + * Protection status of the container. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /** + * Extended Info of the container. + */ + @JsonProperty(value = "extendedInfo") + private DPMContainerExtendedInfo extendedInfo; + + /** + * Get specifies whether the container is re-registrable. + * + * @return the canReRegister value + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set specifies whether the container is re-registrable. + * + * @param canReRegister the canReRegister value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withCanReRegister(Boolean canReRegister) { + this.canReRegister = canReRegister; + return this; + } + + /** + * Get iD of container. + * + * @return the containerId value + */ + public String containerId() { + return this.containerId; + } + + /** + * Set iD of container. + * + * @param containerId the containerId value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get number of protected items in the BackupEngine. + * + * @return the protectedItemCount value + */ + public Long protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set number of protected items in the BackupEngine. + * + * @param protectedItemCount the protectedItemCount value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withProtectedItemCount(Long protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get backup engine Agent version. + * + * @return the dpmAgentVersion value + */ + public String dpmAgentVersion() { + return this.dpmAgentVersion; + } + + /** + * Set backup engine Agent version. + * + * @param dpmAgentVersion the dpmAgentVersion value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withDpmAgentVersion(String dpmAgentVersion) { + this.dpmAgentVersion = dpmAgentVersion; + return this; + } + + /** + * Get list of BackupEngines protecting the container. + * + * @return the dpmServers value + */ + public List dpmServers() { + return this.dpmServers; + } + + /** + * Set list of BackupEngines protecting the container. + * + * @param dpmServers the dpmServers value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withDpmServers(List dpmServers) { + this.dpmServers = dpmServers; + return this; + } + + /** + * Get to check if upgrade available. + * + * @return the upgradeAvailable value + */ + public Boolean upgradeAvailable() { + return this.upgradeAvailable; + } + + /** + * Set to check if upgrade available. + * + * @param upgradeAvailable the upgradeAvailable value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withUpgradeAvailable(Boolean upgradeAvailable) { + this.upgradeAvailable = upgradeAvailable; + return this; + } + + /** + * Get protection status of the container. + * + * @return the protectionStatus value + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set protection status of the container. + * + * @param protectionStatus the protectionStatus value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get extended Info of the container. + * + * @return the extendedInfo value + */ + public DPMContainerExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set extended Info of the container. + * + * @param extendedInfo the extendedInfo value to set + * @return the DpmContainer object itself. + */ + public DpmContainer withExtendedInfo(DPMContainerExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmErrorInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmErrorInfo.java new file mode 100644 index 0000000000000..bcab8f584edc5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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; + + /** + * List of localized recommendations for above error code. + */ + @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 list of localized recommendations for above error code. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set list of localized recommendations for above error code. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmJob.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmJob.java new file mode 100644 index 0000000000000..a08e6de6d6749 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmJob.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.JobInner; + +/** + * DPM workload-specific job object. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType", defaultImpl = DpmJob.class) +@JsonTypeName("DpmJob") +public class DpmJob extends JobInner { + /** + * Time elapsed for job. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * DPM server name managing the backup item or backup job. + */ + @JsonProperty(value = "dpmServerName") + private String dpmServerName; + + /** + * Name of cluster/server protecting current backup item, if any. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * Type of container. + */ + @JsonProperty(value = "containerType") + private String containerType; + + /** + * Type of backup item. + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /** + * The state/actions applicable on this job like cancel/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 time elapsed for job. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set time elapsed for 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 name of cluster/server protecting current backup item, if any. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set name of cluster/server protecting 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 type of container. + * + * @return the containerType value + */ + public String containerType() { + return this.containerType; + } + + /** + * Set 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 type of backup item. + * + * @return the workloadType value + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set 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/actions applicable on this job like cancel/retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the state/actions applicable on this job like cancel/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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmJobExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmJobExtendedInfo.java new file mode 100644 index 0000000000000..2a9b0d4cf430c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmJobTaskDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/DpmJobTaskDetails.java new file mode 100644 index 0000000000000..d5e09f6042745 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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; + + /** + * 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 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 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/EncryptionDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/EncryptionDetails.java new file mode 100644 index 0000000000000..588740e68a121 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/EncryptionDetails.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details needed if the VM was encrypted at the time of backup. + */ +public class EncryptionDetails { + /** + * Identifies whether this backup copy represents an encrypted VM at the + * time of backup. + */ + @JsonProperty(value = "encryptionEnabled") + private Boolean encryptionEnabled; + + /** + * Key Url. + */ + @JsonProperty(value = "kekUrl") + private String kekUrl; + + /** + * Secret Url. + */ + @JsonProperty(value = "secretKeyUrl") + private String secretKeyUrl; + + /** + * ID of Key Vault where KEK is stored. + */ + @JsonProperty(value = "kekVaultId") + private String kekVaultId; + + /** + * ID of Key Vault where Secret is stored. + */ + @JsonProperty(value = "secretKeyVaultId") + private String secretKeyVaultId; + + /** + * Get identifies whether this backup copy represents an encrypted VM at the time of backup. + * + * @return the encryptionEnabled value + */ + public Boolean encryptionEnabled() { + return this.encryptionEnabled; + } + + /** + * Set identifies whether this 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 key Url. + * + * @return the kekUrl value + */ + public String kekUrl() { + return this.kekUrl; + } + + /** + * Set key Url. + * + * @param kekUrl the kekUrl value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekUrl(String kekUrl) { + this.kekUrl = kekUrl; + return this; + } + + /** + * Get secret Url. + * + * @return the secretKeyUrl value + */ + public String secretKeyUrl() { + return this.secretKeyUrl; + } + + /** + * Set secret Url. + * + * @param secretKeyUrl the secretKeyUrl value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withSecretKeyUrl(String secretKeyUrl) { + this.secretKeyUrl = secretKeyUrl; + return this; + } + + /** + * Get iD of Key Vault where KEK is stored. + * + * @return the kekVaultId value + */ + public String kekVaultId() { + return this.kekVaultId; + } + + /** + * Set iD of Key Vault where 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 iD of Key Vault where Secret is stored. + * + * @return the secretKeyVaultId value + */ + public String secretKeyVaultId() { + return this.secretKeyVaultId; + } + + /** + * Set iD of Key Vault where 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/EnhancedSecurityState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/EnhancedSecurityState.java new file mode 100644 index 0000000000000..ae8726312cc2f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/EnhancedSecurityState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EnhancedSecurityState. + */ +public final class EnhancedSecurityState extends ExpandableStringEnum { + /** Static value Invalid for EnhancedSecurityState. */ + public static final EnhancedSecurityState INVALID = fromString("Invalid"); + + /** Static value Enabled for EnhancedSecurityState. */ + public static final EnhancedSecurityState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EnhancedSecurityState. */ + public static final EnhancedSecurityState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EnhancedSecurityState from its string representation. + * @param name a name to look for + * @return the corresponding EnhancedSecurityState + */ + @JsonCreator + public static EnhancedSecurityState fromString(String name) { + return fromString(name, EnhancedSecurityState.class); + } + + /** + * @return known EnhancedSecurityState values + */ + public static Collection values() { + return values(EnhancedSecurityState.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorAdditionalInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..972e6d6e3e396 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorAdditionalInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorDetail.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorDetail.java new file mode 100644 index 0000000000000..88f95523b8336 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorDetail.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error Detail class which encapsulates Code, Message and Recommendations. + */ +public class ErrorDetail { + /** + * Error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Error Message related to the Code. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * List of recommendation strings. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get error Message related to the Code. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get list of recommendation strings. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorResponse.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorResponse.java new file mode 100644 index 0000000000000..91e20ab828772 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorResponse.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error response. + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorResponseException.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorResponseException.java new file mode 100644 index 0000000000000..5a69523d5cf84 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ErrorResponseException.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExportJobsOperationResultInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExportJobsOperationResultInfo.java new file mode 100644 index 0000000000000..30d8b831ceb95 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExportJobsOperationResultInfo.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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", defaultImpl = ExportJobsOperationResultInfo.class) +@JsonTypeName("ExportJobsOperationResultInfo") +public class ExportJobsOperationResultInfo extends OperationResultInfoBase { + /** + * URL of the blob into which the serialized string of list of jobs is + * exported. + */ + @JsonProperty(value = "blobUrl") + private String blobUrl; + + /** + * SAS key to access the blob. It expires in 15 mins. + */ + @JsonProperty(value = "blobSasKey") + private String blobSasKey; + + /** + * URL of the blob into which the ExcelFile is uploaded. + */ + @JsonProperty(value = "excelFileBlobUrl") + private String excelFileBlobUrl; + + /** + * SAS key to access the blob. It expires in 15 mins. + */ + @JsonProperty(value = "excelFileBlobSasKey") + private String excelFileBlobSasKey; + + /** + * Get uRL of the blob into which the serialized string of list of jobs is exported. + * + * @return the blobUrl value + */ + public String blobUrl() { + return this.blobUrl; + } + + /** + * Set uRL of the blob into which the serialized string of list of jobs is exported. + * + * @param blobUrl the blobUrl value to set + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withBlobUrl(String blobUrl) { + this.blobUrl = blobUrl; + return this; + } + + /** + * Get sAS key to access the blob. It expires in 15 mins. + * + * @return the blobSasKey value + */ + public String blobSasKey() { + return this.blobSasKey; + } + + /** + * Set sAS key to access the blob. It expires in 15 mins. + * + * @param blobSasKey the blobSasKey value to set + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withBlobSasKey(String blobSasKey) { + this.blobSasKey = blobSasKey; + return this; + } + + /** + * Get uRL of the blob into which the ExcelFile is uploaded. + * + * @return the excelFileBlobUrl value + */ + public String excelFileBlobUrl() { + return this.excelFileBlobUrl; + } + + /** + * Set uRL of the blob into which the ExcelFile is uploaded. + * + * @param excelFileBlobUrl the excelFileBlobUrl value to set + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withExcelFileBlobUrl(String excelFileBlobUrl) { + this.excelFileBlobUrl = excelFileBlobUrl; + return this; + } + + /** + * Get sAS key to access the blob. It expires in 15 mins. + * + * @return the excelFileBlobSasKey value + */ + public String excelFileBlobSasKey() { + return this.excelFileBlobSasKey; + } + + /** + * Set sAS key to access the blob. It expires in 15 mins. + * + * @param excelFileBlobSasKey the excelFileBlobSasKey value to set + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withExcelFileBlobSasKey(String excelFileBlobSasKey) { + this.excelFileBlobSasKey = excelFileBlobSasKey; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExportJobsOperationResults.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExportJobsOperationResults.java new file mode 100644 index 0000000000000..81fc8f4bbca59 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExportJobsOperationResults.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ExportJobsOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExportJobsOperationResults. + */ +public interface ExportJobsOperationResults extends HasInner { + /** + * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExtendedProperties.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExtendedProperties.java new file mode 100644 index 0000000000000..35fa3c183f67d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ExtendedProperties.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Extended Properties for Azure IaasVM Backup. + */ +public class ExtendedProperties { + /** + * Extended Properties for Disk Exclusion. + */ + @JsonProperty(value = "diskExclusionProperties") + private DiskExclusionProperties diskExclusionProperties; + + /** + * Get extended Properties for Disk Exclusion. + * + * @return the diskExclusionProperties value + */ + public DiskExclusionProperties diskExclusionProperties() { + return this.diskExclusionProperties; + } + + /** + * Set extended Properties for Disk Exclusion. + * + * @param diskExclusionProperties the diskExclusionProperties value to set + * @return the ExtendedProperties object itself. + */ + public ExtendedProperties withDiskExclusionProperties(DiskExclusionProperties diskExclusionProperties) { + this.diskExclusionProperties = diskExclusionProperties; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FabricName.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FabricName.java new file mode 100644 index 0000000000000..5f71a09ffa1db --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FabricName.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FabricName. + */ +public final class FabricName extends ExpandableStringEnum { + /** Static value Invalid for FabricName. */ + public static final FabricName INVALID = fromString("Invalid"); + + /** Static value Azure for FabricName. */ + public static final FabricName AZURE = fromString("Azure"); + + /** + * Creates or finds a FabricName from its string representation. + * @param name a name to look for + * @return the corresponding FabricName + */ + @JsonCreator + public static FabricName fromString(String name) { + return fromString(name, FabricName.class); + } + + /** + * @return known FabricName values + */ + public static Collection values() { + return values(FabricName.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FeatureSupportRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FeatureSupportRequest.java new file mode 100644 index 0000000000000..31d2d6a5405d1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FeatureSupportRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for feature request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "featureType", defaultImpl = FeatureSupportRequest.class) +@JsonTypeName("FeatureSupportRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureBackupGoals", value = AzureBackupGoalFeatureSupportRequest.class), + @JsonSubTypes.Type(name = "AzureVMResourceBackup", value = AzureVMResourceFeatureSupportRequest.class) +}) +public class FeatureSupportRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FeatureSupports.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FeatureSupports.java new file mode 100644 index 0000000000000..306721a3abdae --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/FeatureSupports.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.FeatureSupportsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing FeatureSupports. + */ +public interface FeatureSupports extends HasInner { + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api + * @param parameters Feature support request object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateAsync(String azureRegion, FeatureSupportRequest parameters); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericContainer.java new file mode 100644 index 0000000000000..ed20b9898e018 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericContainer.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * Base class for generic container of backup items. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = GenericContainer.class) +@JsonTypeName("GenericContainer") +public class GenericContainer extends ProtectionContainerInner { + /** + * Name of the container's fabric. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * Extended information (not returned in List container API calls). + */ + @JsonProperty(value = "extendedInformation") + private GenericContainerExtendedInfo extendedInformation; + + /** + * Get name of the container's fabric. + * + * @return the fabricName value + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set name of the container's fabric. + * + * @param fabricName the fabricName value to set + * @return the GenericContainer object itself. + */ + public GenericContainer withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get extended information (not returned in List container API calls). + * + * @return the extendedInformation value + */ + public GenericContainerExtendedInfo extendedInformation() { + return this.extendedInformation; + } + + /** + * Set extended information (not returned in List container API calls). + * + * @param extendedInformation the extendedInformation value to set + * @return the GenericContainer object itself. + */ + public GenericContainer withExtendedInformation(GenericContainerExtendedInfo extendedInformation) { + this.extendedInformation = extendedInformation; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericContainerExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericContainerExtendedInfo.java new file mode 100644 index 0000000000000..1de919c9e87bf --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericContainerExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container extended information. + */ +public class GenericContainerExtendedInfo { + /** + * Public key of container cert. + */ + @JsonProperty(value = "rawCertData") + private String rawCertData; + + /** + * Container identity information. + */ + @JsonProperty(value = "containerIdentityInfo") + private ContainerIdentityInfo containerIdentityInfo; + + /** + * Azure Backup Service Endpoints for the container. + */ + @JsonProperty(value = "serviceEndpoints") + private Map serviceEndpoints; + + /** + * Get public key of container cert. + * + * @return the rawCertData value + */ + public String rawCertData() { + return this.rawCertData; + } + + /** + * Set public key of container cert. + * + * @param rawCertData the rawCertData value to set + * @return the GenericContainerExtendedInfo object itself. + */ + public GenericContainerExtendedInfo withRawCertData(String rawCertData) { + this.rawCertData = rawCertData; + return this; + } + + /** + * Get container identity information. + * + * @return the containerIdentityInfo value + */ + public ContainerIdentityInfo containerIdentityInfo() { + return this.containerIdentityInfo; + } + + /** + * Set container identity information. + * + * @param containerIdentityInfo the containerIdentityInfo value to set + * @return the GenericContainerExtendedInfo object itself. + */ + public GenericContainerExtendedInfo withContainerIdentityInfo(ContainerIdentityInfo containerIdentityInfo) { + this.containerIdentityInfo = containerIdentityInfo; + return this; + } + + /** + * Get azure Backup Service Endpoints for the container. + * + * @return the serviceEndpoints value + */ + public Map serviceEndpoints() { + return this.serviceEndpoints; + } + + /** + * Set azure Backup Service Endpoints for the container. + * + * @param serviceEndpoints the serviceEndpoints value to set + * @return the GenericContainerExtendedInfo object itself. + */ + public GenericContainerExtendedInfo withServiceEndpoints(Map serviceEndpoints) { + this.serviceEndpoints = serviceEndpoints; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericProtectedItem.java new file mode 100644 index 0000000000000..105d53adee8cb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericProtectedItem.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Base class for backup items. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = GenericProtectedItem.class) +@JsonTypeName("GenericProtectedItem") +public class GenericProtectedItem extends ProtectedItem { + /** + * Friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Indicates consistency of policy object and policy applied to this backup + * item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /** + * Backup state of this backup item. Possible values include: 'Invalid', + * 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', + * 'ProtectionPaused'. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /** + * Data Plane Service ID of the protected item. + */ + @JsonProperty(value = "protectedItemId") + private Long protectedItemId; + + /** + * Loosely coupled (type, value) associations (example - parent of a + * protected item). + */ + @JsonProperty(value = "sourceAssociations") + private Map sourceAssociations; + + /** + * Name of this backup item's fabric. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * 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 GenericProtectedItem object itself. + */ + public GenericProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get indicates consistency of policy object and policy applied to this backup item. + * + * @return the policyState value + */ + public String policyState() { + return this.policyState; + } + + /** + * Set indicates consistency of policy object and policy applied to this backup item. + * + * @param policyState the policyState value to set + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + + /** + * Get 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 backup state of this backup item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @param protectionState the protectionState value to set + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get data Plane Service ID of the protected item. + * + * @return the protectedItemId value + */ + public Long protectedItemId() { + return this.protectedItemId; + } + + /** + * Set data Plane Service ID of the protected item. + * + * @param protectedItemId the protectedItemId value to set + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withProtectedItemId(Long protectedItemId) { + this.protectedItemId = protectedItemId; + return this; + } + + /** + * Get loosely coupled (type, value) associations (example - parent of a protected item). + * + * @return the sourceAssociations value + */ + public Map sourceAssociations() { + return this.sourceAssociations; + } + + /** + * Set loosely coupled (type, value) associations (example - parent of a protected item). + * + * @param sourceAssociations the sourceAssociations value to set + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withSourceAssociations(Map sourceAssociations) { + this.sourceAssociations = sourceAssociations; + return this; + } + + /** + * Get name of this backup item's fabric. + * + * @return the fabricName value + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set name of this backup item's fabric. + * + * @param fabricName the fabricName value to set + * @return the GenericProtectedItem object itself. + */ + public GenericProtectedItem withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericProtectionPolicy.java new file mode 100644 index 0000000000000..038daa9205ce9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericProtectionPolicy.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure VM (Mercury) workload-specific backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType", defaultImpl = GenericProtectionPolicy.class) +@JsonTypeName("GenericProtectionPolicy") +public class GenericProtectionPolicy extends ProtectionPolicy { + /** + * List of sub-protection policies which includes schedule and retention. + */ + @JsonProperty(value = "subProtectionPolicy") + private List subProtectionPolicy; + + /** + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * Name of this policy's fabric. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * Get list of sub-protection policies which includes schedule and retention. + * + * @return the subProtectionPolicy value + */ + public List subProtectionPolicy() { + return this.subProtectionPolicy; + } + + /** + * Set list of sub-protection policies which includes schedule and retention. + * + * @param subProtectionPolicy the subProtectionPolicy value to set + * @return the GenericProtectionPolicy object itself. + */ + public GenericProtectionPolicy withSubProtectionPolicy(List subProtectionPolicy) { + this.subProtectionPolicy = subProtectionPolicy; + return this; + } + + /** + * Get timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set + * @return the GenericProtectionPolicy object itself. + */ + public GenericProtectionPolicy withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get name of this policy's fabric. + * + * @return the fabricName value + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set name of this policy's fabric. + * + * @param fabricName the fabricName value to set + * @return the GenericProtectionPolicy object itself. + */ + public GenericProtectionPolicy withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericRecoveryPoint.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericRecoveryPoint.java new file mode 100644 index 0000000000000..277c763430fb9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GenericRecoveryPoint.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Generic backup copy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = GenericRecoveryPoint.class) +@JsonTypeName("GenericRecoveryPoint") +public class GenericRecoveryPoint extends RecoveryPoint { + /** + * Friendly name of the backup copy. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Type of the backup copy. + */ + @JsonProperty(value = "recoveryPointType") + private String recoveryPointType; + + /** + * Time at which 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 time at which this backup copy was created. + * + * @return the recoveryPointTime value + */ + public DateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set time at which 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GetProtectedItemQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/GetProtectedItemQueryObject.java new file mode 100644 index 0000000000000..e362c60a3f9e1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters to list 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HealthState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HealthState.java new file mode 100644 index 0000000000000..45d4b714e825e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HealthState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HealthState. + */ +public final class HealthState extends ExpandableStringEnum { + /** Static value Passed for HealthState. */ + public static final HealthState PASSED = fromString("Passed"); + + /** Static value ActionRequired for HealthState. */ + public static final HealthState ACTION_REQUIRED = fromString("ActionRequired"); + + /** Static value ActionSuggested for HealthState. */ + public static final HealthState ACTION_SUGGESTED = fromString("ActionSuggested"); + + /** Static value Invalid for HealthState. */ + public static final HealthState INVALID = fromString("Invalid"); + + /** + * Creates or finds a HealthState from its string representation. + * @param name a name to look for + * @return the corresponding HealthState + */ + @JsonCreator + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** + * @return known HealthState values + */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HealthStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HealthStatus.java new file mode 100644 index 0000000000000..7becc123d666b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HealthStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HealthStatus. + */ +public final class HealthStatus extends ExpandableStringEnum { + /** Static value Passed for HealthStatus. */ + public static final HealthStatus PASSED = fromString("Passed"); + + /** Static value ActionRequired for HealthStatus. */ + public static final HealthStatus ACTION_REQUIRED = fromString("ActionRequired"); + + /** Static value ActionSuggested for HealthStatus. */ + public static final HealthStatus ACTION_SUGGESTED = fromString("ActionSuggested"); + + /** Static value Invalid for HealthStatus. */ + public static final HealthStatus INVALID = fromString("Invalid"); + + /** + * Creates or finds a HealthStatus from its string representation. + * @param name a name to look for + * @return the corresponding HealthStatus + */ + @JsonCreator + public static HealthStatus fromString(String name) { + return fromString(name, HealthStatus.class); + } + + /** + * @return known HealthStatus values + */ + public static Collection values() { + return values(HealthStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HttpStatusCode.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/HttpStatusCode.java new file mode 100644 index 0000000000000..2dbc00675d295 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ILRRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ILRRequest.java new file mode 100644 index 0000000000000..2e1af1686c11c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ILRRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Parameters to Provision ILR API. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = ILRRequest.class) +@JsonTypeName("ILRRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareProvisionILRRequest", value = AzureFileShareProvisionILRRequest.class), + @JsonSubTypes.Type(name = "IaasVMILRRegistrationRequest", value = IaasVMILRRegistrationRequest.class) +}) +public class ILRRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ILRRequestResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ILRRequestResource.java new file mode 100644 index 0000000000000..63446234b0a29 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ILRRequestResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters to Provision ILR API. + */ +@SkipParentValidation +public class ILRRequestResource extends Resource { + /** + * ILRRequestResource properties. + */ + @JsonProperty(value = "properties") + private ILRRequest properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get iLRRequestResource properties. + * + * @return the properties value + */ + public ILRRequest properties() { + return this.properties; + } + + /** + * Set iLRRequestResource properties. + * + * @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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaaSVMContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaaSVMContainer.java new file mode 100644 index 0000000000000..f4a76bd4b0333 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * IaaS VM workload-specific container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = IaaSVMContainer.class) +@JsonTypeName("IaaSVMContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Microsoft.ClassicCompute/virtualMachines", value = AzureIaaSClassicComputeVMContainer.class), + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMContainer.class) +}) +public class IaaSVMContainer extends ProtectionContainerInner { + /** + * Fully qualified ARM 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 an Azure + * Resource Manager VM. + */ + @JsonProperty(value = "virtualMachineVersion") + private String virtualMachineVersion; + + /** + * Resource group name of Recovery Services Vault. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * Get fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set fully qualified ARM 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 an Azure Resource Manager VM. + * + * @return the virtualMachineVersion value + */ + public String virtualMachineVersion() { + return this.virtualMachineVersion; + } + + /** + * Set specifies whether the container represents a Classic or an Azure Resource Manager VM. + * + * @param virtualMachineVersion the virtualMachineVersion value to set + * @return the IaaSVMContainer object itself. + */ + public IaaSVMContainer withVirtualMachineVersion(String virtualMachineVersion) { + this.virtualMachineVersion = virtualMachineVersion; + return this; + } + + /** + * Get resource group name of Recovery Services Vault. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set resource group name of 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaaSVMProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaaSVMProtectableItem.java new file mode 100644 index 0000000000000..e707c3b7f8eab --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaaSVMProtectableItem.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * IaaS VM workload-specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType", defaultImpl = IaaSVMProtectableItem.class) +@JsonTypeName("IaaSVMProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Microsoft.ClassicCompute/virtualMachines", value = AzureIaaSClassicComputeVMProtectableItem.class), + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMProtectableItem.class) +}) +public class IaaSVMProtectableItem extends WorkloadProtectableItem { + /** + * Fully qualified ARM ID of the virtual machine. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * Get fully qualified ARM ID of the virtual machine. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set fully qualified ARM 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMBackupRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMBackupRequest.java new file mode 100644 index 0000000000000..af4b071cb2bb7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMBackupRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = IaasVMBackupRequest.class) +@JsonTypeName("IaasVMBackupRequest") +public class IaasVMBackupRequest extends BackupRequest { + /** + * Backup copy will expire after the time specified (UTC). + */ + @JsonProperty(value = "recoveryPointExpiryTimeInUTC") + private DateTime recoveryPointExpiryTimeInUTC; + + /** + * Get backup copy will expire after the time specified (UTC). + * + * @return the recoveryPointExpiryTimeInUTC value + */ + public DateTime recoveryPointExpiryTimeInUTC() { + return this.recoveryPointExpiryTimeInUTC; + } + + /** + * Set backup copy will expire after the time specified (UTC). + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMILRRegistrationRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMILRRegistrationRequest.java new file mode 100644 index 0000000000000..cb4f63c11f0bb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMILRRegistrationRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Restore files/folders from a backup copy of IaaS VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = IaasVMILRRegistrationRequest.class) +@JsonTypeName("IaasVMILRRegistrationRequest") +public class IaasVMILRRegistrationRequest extends ILRRequest { + /** + * ID of the IaaS VM backup copy from where the files/folders have to be + * restored. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** + * Fully qualified ARM ID of the virtual machine whose the files / folders + * have to be restored. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * iSCSI initiator name. + */ + @JsonProperty(value = "initiatorName") + private String initiatorName; + + /** + * Whether to renew existing registration with the iSCSI server. + */ + @JsonProperty(value = "renewExistingRegistration") + private Boolean renewExistingRegistration; + + /** + * Get iD of the IaaS VM backup copy from where the files/folders have to be restored. + * + * @return the recoveryPointId value + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set iD of the IaaS VM backup copy from where the files/folders have to be restored. + * + * @param recoveryPointId the recoveryPointId value to set + * @return the IaasVMILRRegistrationRequest object itself. + */ + public IaasVMILRRegistrationRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. + * + * @param virtualMachineId the virtualMachineId value to set + * @return the IaasVMILRRegistrationRequest object itself. + */ + public IaasVMILRRegistrationRequest withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Get iSCSI initiator name. + * + * @return the initiatorName value + */ + public String initiatorName() { + return this.initiatorName; + } + + /** + * Set 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 existing registration with the iSCSI server. + * + * @return the renewExistingRegistration value + */ + public Boolean renewExistingRegistration() { + return this.renewExistingRegistration; + } + + /** + * Set whether to renew 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMRecoveryPoint.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMRecoveryPoint.java new file mode 100644 index 0000000000000..82140d168a09a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMRecoveryPoint.java @@ -0,0 +1,309 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload specific backup copy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = IaasVMRecoveryPoint.class) +@JsonTypeName("IaasVMRecoveryPoint") +public class IaasVMRecoveryPoint extends RecoveryPoint { + /** + * Type of the backup copy. + */ + @JsonProperty(value = "recoveryPointType", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryPointType; + + /** + * Time at which this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime recoveryPointTime; + + /** + * Additional information associated with this backup copy. + */ + @JsonProperty(value = "recoveryPointAdditionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private String recoveryPointAdditionalInfo; + + /** + * Storage type of the VM whose backup copy is created. + */ + @JsonProperty(value = "sourceVMStorageType", access = JsonProperty.Access.WRITE_ONLY) + private String sourceVMStorageType; + + /** + * Identifies whether the VM was encrypted when the backup copy is created. + */ + @JsonProperty(value = "isSourceVMEncrypted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isSourceVMEncrypted; + + /** + * Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + */ + @JsonProperty(value = "keyAndSecret") + private KeyAndSecretDetails keyAndSecret; + + /** + * Is the session to recover items from this backup copy still active. + */ + @JsonProperty(value = "isInstantIlrSessionActive") + private Boolean isInstantIlrSessionActive; + + /** + * Recovery point tier information. + */ + @JsonProperty(value = "recoveryPointTierDetails") + private List recoveryPointTierDetails; + + /** + * Whether VM is with Managed Disks. + */ + @JsonProperty(value = "isManagedVirtualMachine") + private Boolean isManagedVirtualMachine; + + /** + * Virtual Machine Size. + */ + @JsonProperty(value = "virtualMachineSize") + private String virtualMachineSize; + + /** + * Original Storage Account Option. + */ + @JsonProperty(value = "originalStorageAccountOption") + private Boolean originalStorageAccountOption; + + /** + * OS type. + */ + @JsonProperty(value = "osType") + private String osType; + + /** + * Disk configuration. + */ + @JsonProperty(value = "recoveryPointDiskConfiguration") + private RecoveryPointDiskConfiguration recoveryPointDiskConfiguration; + + /** + * Get type of the backup copy. + * + * @return the recoveryPointType value + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Get time at which this backup copy was created. + * + * @return the recoveryPointTime value + */ + public DateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Get additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Get storage type of the VM whose backup copy is created. + * + * @return the sourceVMStorageType value + */ + public String sourceVMStorageType() { + return this.sourceVMStorageType; + } + + /** + * Get identifies whether the VM was encrypted when the backup copy is created. + * + * @return the isSourceVMEncrypted value + */ + public Boolean isSourceVMEncrypted() { + return this.isSourceVMEncrypted; + } + + /** + * 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 is the session to recover items from this backup copy still active. + * + * @return the isInstantIlrSessionActive value + */ + public Boolean isInstantIlrSessionActive() { + return this.isInstantIlrSessionActive; + } + + /** + * Set 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; + } + + /** + * Get recovery point tier information. + * + * @return the recoveryPointTierDetails value + */ + public List recoveryPointTierDetails() { + return this.recoveryPointTierDetails; + } + + /** + * Set recovery point tier information. + * + * @param recoveryPointTierDetails the recoveryPointTierDetails value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointTierDetails(List recoveryPointTierDetails) { + this.recoveryPointTierDetails = recoveryPointTierDetails; + return this; + } + + /** + * Get whether VM is with Managed Disks. + * + * @return the isManagedVirtualMachine value + */ + public Boolean isManagedVirtualMachine() { + return this.isManagedVirtualMachine; + } + + /** + * Set whether VM is with Managed Disks. + * + * @param isManagedVirtualMachine the isManagedVirtualMachine value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withIsManagedVirtualMachine(Boolean isManagedVirtualMachine) { + this.isManagedVirtualMachine = isManagedVirtualMachine; + return this; + } + + /** + * Get virtual Machine Size. + * + * @return the virtualMachineSize value + */ + public String virtualMachineSize() { + return this.virtualMachineSize; + } + + /** + * Set virtual Machine Size. + * + * @param virtualMachineSize the virtualMachineSize value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withVirtualMachineSize(String virtualMachineSize) { + this.virtualMachineSize = virtualMachineSize; + return this; + } + + /** + * Get original Storage Account Option. + * + * @return the originalStorageAccountOption value + */ + public Boolean originalStorageAccountOption() { + return this.originalStorageAccountOption; + } + + /** + * Set original Storage Account Option. + * + * @param originalStorageAccountOption the originalStorageAccountOption value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { + this.originalStorageAccountOption = originalStorageAccountOption; + return this; + } + + /** + * Get oS type. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set oS type. + * + * @param osType the osType value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get disk configuration. + * + * @return the recoveryPointDiskConfiguration value + */ + public RecoveryPointDiskConfiguration recoveryPointDiskConfiguration() { + return this.recoveryPointDiskConfiguration; + } + + /** + * Set disk configuration. + * + * @param recoveryPointDiskConfiguration the recoveryPointDiskConfiguration value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointDiskConfiguration(RecoveryPointDiskConfiguration recoveryPointDiskConfiguration) { + this.recoveryPointDiskConfiguration = recoveryPointDiskConfiguration; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMRestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMRestoreRequest.java new file mode 100644 index 0000000000000..9c37ba0a62022 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IaasVMRestoreRequest.java @@ -0,0 +1,445 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +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", defaultImpl = IaasVMRestoreRequest.class) +@JsonTypeName("IaasVMRestoreRequest") +public class IaasVMRestoreRequest extends RestoreRequest { + /** + * ID of the backup copy to be recovered. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** + * Type of this recovery. Possible values include: 'Invalid', + * 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + */ + @JsonProperty(value = "recoveryType") + private RecoveryType recoveryType; + + /** + * Fully qualified ARM ID of the VM which is being recovered. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * This is the complete ARM Id of the VM that will be created. + * For e.g. + * /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + */ + @JsonProperty(value = "targetVirtualMachineId") + private String targetVirtualMachineId; + + /** + * This is the ARM Id of the resource group that you want to create for + * this Virtual machine and other artifacts. + * For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + */ + @JsonProperty(value = "targetResourceGroupId") + private String targetResourceGroupId; + + /** + * Fully qualified ARM ID of the storage account to which the VM has to be + * restored. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /** + * This is the virtual network Id of the vnet that will be attached to the + * virtual machine. + * User will be validated for join action permissions in the linked access. + */ + @JsonProperty(value = "virtualNetworkId") + private String virtualNetworkId; + + /** + * Subnet ID, is the subnet ID associated with the to be restored VM. For + * Classic VMs it would be + * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it + * would be ARM resource ID used to represent + * the subnet. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** + * Fully qualified ARM ID of the domain name to be associated to the VM + * being restored. This applies only to Classic + * Virtual Machines. + */ + @JsonProperty(value = "targetDomainNameId") + private String targetDomainNameId; + + /** + * Region in which the virtual machine is restored. + */ + @JsonProperty(value = "region") + private String region; + + /** + * Affinity group associated to VM to be restored. Used only for Classic + * Compute Virtual Machines. + */ + @JsonProperty(value = "affinityGroup") + private String affinityGroup; + + /** + * Should a new cloud service be created while restoring the VM. If this is + * false, VM will be restored to the same + * cloud service as it was at the time of backup. + */ + @JsonProperty(value = "createNewCloudService") + private Boolean createNewCloudService; + + /** + * Original Storage Account Option. + */ + @JsonProperty(value = "originalStorageAccountOption") + private Boolean originalStorageAccountOption; + + /** + * Details needed if the VM was encrypted at the time of backup. + */ + @JsonProperty(value = "encryptionDetails") + private EncryptionDetails encryptionDetails; + + /** + * List of Disk LUNs for partial restore. + */ + @JsonProperty(value = "restoreDiskLunList") + private List restoreDiskLunList; + + /** + * Get iD of the backup copy to be recovered. + * + * @return the recoveryPointId value + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set 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 type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + * + * @return the recoveryType value + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks', 'Offline'. + * + * @param recoveryType the recoveryType value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get fully qualified ARM ID of the VM which is being recovered. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set fully qualified ARM ID of the VM which is 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 this is the complete ARM Id of the VM that will be created. + For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @return the targetVirtualMachineId value + */ + public String targetVirtualMachineId() { + return this.targetVirtualMachineId; + } + + /** + * Set this is the complete ARM Id of the VM that will be created. + For e.g. /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 this is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + * + * @return the targetResourceGroupId value + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set this is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. + For e.g. /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 fully qualified ARM ID of the storage account to which the VM has to be restored. + * + * @return the storageAccountId value + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set fully qualified ARM ID of the storage account to which the VM has to 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 will be attached to the virtual machine. + User will be validated for join action permissions in the linked access. + * + * @return the virtualNetworkId value + */ + public String virtualNetworkId() { + return this.virtualNetworkId; + } + + /** + * Set this is the virtual network Id of the vnet that will be attached to the virtual machine. + User will be validated for join action permissions in 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 subnet ID associated with the to be restored VM. For Classic VMs it would be + {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to represent + the subnet. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be + {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM 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 fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + Virtual Machines. + * + * @return the targetDomainNameId value + */ + public String targetDomainNameId() { + return this.targetDomainNameId; + } + + /** + * Set fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic + 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 region in which the virtual machine is restored. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set region in which 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 affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. + * + * @return the affinityGroup value + */ + public String affinityGroup() { + return this.affinityGroup; + } + + /** + * Set affinity group associated to VM to be restored. Used only for Classic Compute 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 should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + cloud service as it was at the time of backup. + * + * @return the createNewCloudService value + */ + public Boolean createNewCloudService() { + return this.createNewCloudService; + } + + /** + * Set should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same + cloud service as it was at the time of backup. + * + * @param createNewCloudService the createNewCloudService value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withCreateNewCloudService(Boolean createNewCloudService) { + this.createNewCloudService = createNewCloudService; + return this; + } + + /** + * Get original Storage Account Option. + * + * @return the originalStorageAccountOption value + */ + public Boolean originalStorageAccountOption() { + return this.originalStorageAccountOption; + } + + /** + * Set original Storage Account Option. + * + * @param originalStorageAccountOption the originalStorageAccountOption value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { + this.originalStorageAccountOption = originalStorageAccountOption; + return this; + } + + /** + * Get details needed if the VM was encrypted at the time of backup. + * + * @return the encryptionDetails value + */ + public EncryptionDetails encryptionDetails() { + return this.encryptionDetails; + } + + /** + * Set details needed if the VM was encrypted at the time of backup. + * + * @param encryptionDetails the encryptionDetails value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withEncryptionDetails(EncryptionDetails encryptionDetails) { + this.encryptionDetails = encryptionDetails; + return this; + } + + /** + * Get list of Disk LUNs for partial restore. + * + * @return the restoreDiskLunList value + */ + public List restoreDiskLunList() { + return this.restoreDiskLunList; + } + + /** + * Set list of Disk LUNs for partial restore. + * + * @param restoreDiskLunList the restoreDiskLunList value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRestoreDiskLunList(List restoreDiskLunList) { + this.restoreDiskLunList = restoreDiskLunList; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryInfo.java new file mode 100644 index 0000000000000..b625dc07fa748 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryInfo.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about inquired protectable items under a given container. + */ +public class InquiryInfo { + /** + * Inquiry Status for this container such as + * InProgress | Failed | Succeeded. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Error Details if the Status is non-success. + */ + @JsonProperty(value = "errorDetail") + private ErrorDetail errorDetail; + + /** + * Inquiry Details which will have workload specific details. + * For e.g. - For SQL and oracle this will contain different details. + */ + @JsonProperty(value = "inquiryDetails") + private List inquiryDetails; + + /** + * Get inquiry Status for this container such as + InProgress | Failed | Succeeded. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set inquiry Status for this container such as + InProgress | Failed | Succeeded. + * + * @param status the status value to set + * @return the InquiryInfo object itself. + */ + public InquiryInfo withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get error Details if the Status is non-success. + * + * @return the errorDetail value + */ + public ErrorDetail errorDetail() { + return this.errorDetail; + } + + /** + * Set error Details if the Status is non-success. + * + * @param errorDetail the errorDetail value to set + * @return the InquiryInfo object itself. + */ + public InquiryInfo withErrorDetail(ErrorDetail errorDetail) { + this.errorDetail = errorDetail; + return this; + } + + /** + * Get inquiry Details which will have workload specific details. + For e.g. - For SQL and oracle this will contain different details. + * + * @return the inquiryDetails value + */ + public List inquiryDetails() { + return this.inquiryDetails; + } + + /** + * Set inquiry Details which will have workload specific details. + For e.g. - For SQL and oracle this will contain different details. + * + * @param inquiryDetails the inquiryDetails value to set + * @return the InquiryInfo object itself. + */ + public InquiryInfo withInquiryDetails(List inquiryDetails) { + this.inquiryDetails = inquiryDetails; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryStatus.java new file mode 100644 index 0000000000000..5afe065673cc0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InquiryStatus. + */ +public final class InquiryStatus extends ExpandableStringEnum { + /** Static value Invalid for InquiryStatus. */ + public static final InquiryStatus INVALID = fromString("Invalid"); + + /** Static value Success for InquiryStatus. */ + public static final InquiryStatus SUCCESS = fromString("Success"); + + /** Static value Failed for InquiryStatus. */ + public static final InquiryStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a InquiryStatus from its string representation. + * @param name a name to look for + * @return the corresponding InquiryStatus + */ + @JsonCreator + public static InquiryStatus fromString(String name) { + return fromString(name, InquiryStatus.class); + } + + /** + * @return known InquiryStatus values + */ + public static Collection values() { + return values(InquiryStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryValidation.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryValidation.java new file mode 100644 index 0000000000000..d6c026af65672 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InquiryValidation.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Validation for inquired protectable items under a given container. + */ +public class InquiryValidation { + /** + * Status for the Inquiry Validation. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Error Detail in case the status is non-success. + */ + @JsonProperty(value = "errorDetail") + private ErrorDetail errorDetail; + + /** + * Error Additional Detail in case the status is non-success. + */ + @JsonProperty(value = "additionalDetail", access = JsonProperty.Access.WRITE_ONLY) + private String additionalDetail; + + /** + * Get status for the Inquiry Validation. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status for the Inquiry Validation. + * + * @param status the status value to set + * @return the InquiryValidation object itself. + */ + public InquiryValidation withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get error Detail in case the status is non-success. + * + * @return the errorDetail value + */ + public ErrorDetail errorDetail() { + return this.errorDetail; + } + + /** + * Set error Detail in case the status is non-success. + * + * @param errorDetail the errorDetail value to set + * @return the InquiryValidation object itself. + */ + public InquiryValidation withErrorDetail(ErrorDetail errorDetail) { + this.errorDetail = errorDetail; + return this; + } + + /** + * Get error Additional Detail in case the status is non-success. + * + * @return the additionalDetail value + */ + public String additionalDetail() { + return this.additionalDetail; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InstantItemRecoveryTarget.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InstantItemRecoveryTarget.java new file mode 100644 index 0000000000000..4a353207cfe02 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Target details for file / 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InstantRPAdditionalDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InstantRPAdditionalDetails.java new file mode 100644 index 0000000000000..feea48f520d3a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/InstantRPAdditionalDetails.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The InstantRPAdditionalDetails model. + */ +public class InstantRPAdditionalDetails { + /** + * The azureBackupRGNamePrefix property. + */ + @JsonProperty(value = "azureBackupRGNamePrefix") + private String azureBackupRGNamePrefix; + + /** + * The azureBackupRGNameSuffix property. + */ + @JsonProperty(value = "azureBackupRGNameSuffix") + private String azureBackupRGNameSuffix; + + /** + * Get the azureBackupRGNamePrefix value. + * + * @return the azureBackupRGNamePrefix value + */ + public String azureBackupRGNamePrefix() { + return this.azureBackupRGNamePrefix; + } + + /** + * Set the azureBackupRGNamePrefix value. + * + * @param azureBackupRGNamePrefix the azureBackupRGNamePrefix value to set + * @return the InstantRPAdditionalDetails object itself. + */ + public InstantRPAdditionalDetails withAzureBackupRGNamePrefix(String azureBackupRGNamePrefix) { + this.azureBackupRGNamePrefix = azureBackupRGNamePrefix; + return this; + } + + /** + * Get the azureBackupRGNameSuffix value. + * + * @return the azureBackupRGNameSuffix value + */ + public String azureBackupRGNameSuffix() { + return this.azureBackupRGNameSuffix; + } + + /** + * Set the azureBackupRGNameSuffix value. + * + * @param azureBackupRGNameSuffix the azureBackupRGNameSuffix value to set + * @return the InstantRPAdditionalDetails object itself. + */ + public InstantRPAdditionalDetails withAzureBackupRGNameSuffix(String azureBackupRGNameSuffix) { + this.azureBackupRGNameSuffix = azureBackupRGNameSuffix; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IntentItemType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IntentItemType.java new file mode 100644 index 0000000000000..d08c50f238823 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/IntentItemType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IntentItemType. + */ +public final class IntentItemType extends ExpandableStringEnum { + /** Static value Invalid for IntentItemType. */ + public static final IntentItemType INVALID = fromString("Invalid"); + + /** Static value SQLInstance for IntentItemType. */ + public static final IntentItemType SQLINSTANCE = fromString("SQLInstance"); + + /** Static value SQLAvailabilityGroupContainer for IntentItemType. */ + public static final IntentItemType SQLAVAILABILITY_GROUP_CONTAINER = fromString("SQLAvailabilityGroupContainer"); + + /** + * Creates or finds a IntentItemType from its string representation. + * @param name a name to look for + * @return the corresponding IntentItemType + */ + @JsonCreator + public static IntentItemType fromString(String name) { + return fromString(name, IntentItemType.class); + } + + /** + * @return known IntentItemType values + */ + public static Collection values() { + return values(IntentItemType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ItemLevelRecoveryConnections.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ItemLevelRecoveryConnections.java new file mode 100644 index 0000000000000..dac6642047675 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ItemLevelRecoveryConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Completable; + +/** + * Type representing ItemLevelRecoveryConnections. + */ +public interface ItemLevelRecoveryConnections { + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status of + provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + for this backed up data. + * @param parameters resource 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 parameters); + + /** + * 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + this backed up 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); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobCancellations.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobCancellations.java new file mode 100644 index 0000000000000..eb0faf581ba4e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobCancellations.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.JobCancellationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing JobCancellations. + */ +public interface JobCancellations extends HasInner { + /** + * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobDetails.java new file mode 100644 index 0000000000000..d80e8af617b3d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobOperationResults.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobOperationResults.java new file mode 100644 index 0000000000000..243864894c64a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.JobOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing JobOperationResults. + */ +public interface JobOperationResults extends HasInner { + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobOperationType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobOperationType.java new file mode 100644 index 0000000000000..02ad571420d33 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for JobOperationType. + */ +public final class JobOperationType extends ExpandableStringEnum { + /** Static value Invalid for JobOperationType. */ + public static final JobOperationType INVALID = fromString("Invalid"); + + /** Static value Register for JobOperationType. */ + public static final JobOperationType REGISTER = fromString("Register"); + + /** Static value UnRegister for JobOperationType. */ + public static final JobOperationType UN_REGISTER = fromString("UnRegister"); + + /** Static value ConfigureBackup for JobOperationType. */ + public static final JobOperationType CONFIGURE_BACKUP = fromString("ConfigureBackup"); + + /** Static value Backup for JobOperationType. */ + public static final JobOperationType BACKUP = fromString("Backup"); + + /** Static value Restore for JobOperationType. */ + public static final JobOperationType RESTORE = fromString("Restore"); + + /** Static value DisableBackup for JobOperationType. */ + public static final JobOperationType DISABLE_BACKUP = fromString("DisableBackup"); + + /** Static value DeleteBackupData for JobOperationType. */ + public static final JobOperationType DELETE_BACKUP_DATA = fromString("DeleteBackupData"); + + /** Static value CrossRegionRestore for JobOperationType. */ + public static final JobOperationType CROSS_REGION_RESTORE = fromString("CrossRegionRestore"); + + /** Static value Undelete for JobOperationType. */ + public static final JobOperationType UNDELETE = fromString("Undelete"); + + /** + * Creates or finds a JobOperationType from its string representation. + * @param name a name to look for + * @return the corresponding JobOperationType + */ + @JsonCreator + public static JobOperationType fromString(String name) { + return fromString(name, JobOperationType.class); + } + + /** + * @return known JobOperationType values + */ + public static Collection values() { + return values(JobOperationType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobQueryObject.java new file mode 100644 index 0000000000000..365d278dcfee6 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobQueryObject.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Type of operation. Possible values include: 'Invalid', 'Register', + * 'UnRegister', 'ConfigureBackup', 'Backup', 'Restore', 'DisableBackup', + * 'DeleteBackupData', 'CrossRegionRestore', 'Undelete'. + */ + @JsonProperty(value = "operation") + private JobOperationType operation; + + /** + * JobID represents the job uniquely. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /** + * Job has started at this time. Value is in UTC. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * Job has ended at this time. 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', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @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', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get type of operation. Possible values include: 'Invalid', 'Register', 'UnRegister', 'ConfigureBackup', 'Backup', 'Restore', 'DisableBackup', 'DeleteBackupData', 'CrossRegionRestore', 'Undelete'. + * + * @return the operation value + */ + public JobOperationType operation() { + return this.operation; + } + + /** + * Set type of operation. Possible values include: 'Invalid', 'Register', 'UnRegister', 'ConfigureBackup', 'Backup', 'Restore', 'DisableBackup', 'DeleteBackupData', 'CrossRegionRestore', 'Undelete'. + * + * @param operation the operation value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withOperation(JobOperationType operation) { + this.operation = operation; + return this; + } + + /** + * Get jobID represents the job uniquely. + * + * @return the jobId value + */ + public String jobId() { + return this.jobId; + } + + /** + * Set jobID represents the job uniquely. + * + * @param jobId the jobId value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get job has started at this time. Value is in UTC. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set job has started at this time. 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 job has ended at this time. Value is in UTC. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set job has ended at this time. 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobStatus.java new file mode 100644 index 0000000000000..fb9c70fb89cc1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for JobStatus. + */ +public final class JobStatus extends ExpandableStringEnum { + /** Static value Invalid for JobStatus. */ + public static final JobStatus INVALID = fromString("Invalid"); + + /** Static value InProgress for JobStatus. */ + public static final JobStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for JobStatus. */ + public static final JobStatus COMPLETED = fromString("Completed"); + + /** Static value Failed for JobStatus. */ + public static final JobStatus FAILED = fromString("Failed"); + + /** Static value CompletedWithWarnings for JobStatus. */ + public static final JobStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** Static value Cancelled for JobStatus. */ + public static final JobStatus CANCELLED = fromString("Cancelled"); + + /** Static value Cancelling for JobStatus. */ + public static final JobStatus CANCELLING = fromString("Cancelling"); + + /** + * Creates or finds a JobStatus from its string representation. + * @param name a name to look for + * @return the corresponding JobStatus + */ + @JsonCreator + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** + * @return known JobStatus values + */ + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobSupportedAction.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/JobSupportedAction.java new file mode 100644 index 0000000000000..298515ed5fe1d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Jobs.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Jobs.java new file mode 100644 index 0000000000000..0802f39766f69 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Jobs.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Jobs. + */ +public interface Jobs extends HasInner { + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable exportAsync(String vaultName, String resourceGroupName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KEKDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KEKDetails.java new file mode 100644 index 0000000000000..6c8fb6a16b3fa --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KEKDetails.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * KEK is encryption key for BEK. + */ +public class KEKDetails { + /** + * Key is KEK. + */ + @JsonProperty(value = "keyUrl") + private String keyUrl; + + /** + * Key Vault ID where this Key is stored. + */ + @JsonProperty(value = "keyVaultId") + private String keyVaultId; + + /** + * KEK data. + */ + @JsonProperty(value = "keyBackupData") + private String keyBackupData; + + /** + * Get key is KEK. + * + * @return the keyUrl value + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set key is KEK. + * + * @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 where this Key is stored. + * + * @return the keyVaultId value + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set key Vault ID where this Key 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 kEK data. + * + * @return the keyBackupData value + */ + public String keyBackupData() { + return this.keyBackupData; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KPIResourceHealthDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KPIResourceHealthDetails.java new file mode 100644 index 0000000000000..bac3a7b5205d1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KPIResourceHealthDetails.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * KPI Resource Health Details. + */ +public class KPIResourceHealthDetails { + /** + * Resource Health Status. Possible values include: 'Healthy', + * 'TransientDegraded', 'PersistentDegraded', 'TransientUnhealthy', + * 'PersistentUnhealthy', 'Invalid'. + */ + @JsonProperty(value = "resourceHealthStatus") + private ResourceHealthStatus resourceHealthStatus; + + /** + * Resource Health Status. + */ + @JsonProperty(value = "resourceHealthDetails") + private List resourceHealthDetails; + + /** + * Get resource Health Status. Possible values include: 'Healthy', 'TransientDegraded', 'PersistentDegraded', 'TransientUnhealthy', 'PersistentUnhealthy', 'Invalid'. + * + * @return the resourceHealthStatus value + */ + public ResourceHealthStatus resourceHealthStatus() { + return this.resourceHealthStatus; + } + + /** + * Set resource Health Status. Possible values include: 'Healthy', 'TransientDegraded', 'PersistentDegraded', 'TransientUnhealthy', 'PersistentUnhealthy', 'Invalid'. + * + * @param resourceHealthStatus the resourceHealthStatus value to set + * @return the KPIResourceHealthDetails object itself. + */ + public KPIResourceHealthDetails withResourceHealthStatus(ResourceHealthStatus resourceHealthStatus) { + this.resourceHealthStatus = resourceHealthStatus; + return this; + } + + /** + * Get resource Health Status. + * + * @return the resourceHealthDetails value + */ + public List resourceHealthDetails() { + return this.resourceHealthDetails; + } + + /** + * Set resource Health Status. + * + * @param resourceHealthDetails the resourceHealthDetails value to set + * @return the KPIResourceHealthDetails object itself. + */ + public KPIResourceHealthDetails withResourceHealthDetails(List resourceHealthDetails) { + this.resourceHealthDetails = resourceHealthDetails; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KeyAndSecretDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KeyAndSecretDetails.java new file mode 100644 index 0000000000000..c1210bcbc3d98 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/KeyAndSecretDetails.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BEK is bitlocker key. + * KEK is encryption key for BEK + * If the VM was encrypted then we will store following details : + * 1. Secret(BEK) - Url + Backup Data + vaultId. + * 2. Key(KEK) - Url + Backup Data + vaultId. + * 3. EncryptionMechanism + * BEK and KEK can potentially have different vault ids. + */ +public class KeyAndSecretDetails { + /** + * KEK is encryption key for BEK. + */ + @JsonProperty(value = "kekDetails") + private KEKDetails kekDetails; + + /** + * BEK is bitlocker encryption key. + */ + @JsonProperty(value = "bekDetails") + private BEKDetails bekDetails; + + /** + * Encryption mechanism: None/ SinglePass/ DoublePass. + */ + @JsonProperty(value = "encryptionMechanism") + private String encryptionMechanism; + + /** + * Get kEK is encryption key for BEK. + * + * @return the kekDetails value + */ + public KEKDetails kekDetails() { + return this.kekDetails; + } + + /** + * Set kEK is encryption key for 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; + } + + /** + * Get encryption mechanism: None/ SinglePass/ DoublePass. + * + * @return the encryptionMechanism value + */ + public String encryptionMechanism() { + return this.encryptionMechanism; + } + + /** + * Set encryption mechanism: None/ SinglePass/ DoublePass. + * + * @param encryptionMechanism the encryptionMechanism value to set + * @return the KeyAndSecretDetails object itself. + */ + public KeyAndSecretDetails withEncryptionMechanism(String encryptionMechanism) { + this.encryptionMechanism = encryptionMechanism; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LastBackupStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LastBackupStatus.java new file mode 100644 index 0000000000000..e889964587a4b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LastBackupStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LastBackupStatus. + */ +public final class LastBackupStatus extends ExpandableStringEnum { + /** Static value Invalid for LastBackupStatus. */ + public static final LastBackupStatus INVALID = fromString("Invalid"); + + /** Static value Healthy for LastBackupStatus. */ + public static final LastBackupStatus HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for LastBackupStatus. */ + public static final LastBackupStatus UNHEALTHY = fromString("Unhealthy"); + + /** Static value IRPending for LastBackupStatus. */ + public static final LastBackupStatus IRPENDING = fromString("IRPending"); + + /** + * Creates or finds a LastBackupStatus from its string representation. + * @param name a name to look for + * @return the corresponding LastBackupStatus + */ + @JsonCreator + public static LastBackupStatus fromString(String name) { + return fromString(name, LastBackupStatus.class); + } + + /** + * @return known LastBackupStatus values + */ + public static Collection values() { + return values(LastBackupStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LogSchedulePolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LogSchedulePolicy.java new file mode 100644 index 0000000000000..3c8c87e2a18f7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LogSchedulePolicy.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Log policy schedule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType", defaultImpl = LogSchedulePolicy.class) +@JsonTypeName("LogSchedulePolicy") +public class LogSchedulePolicy extends SchedulePolicy { + /** + * Frequency of the log schedule operation of this policy in minutes. + */ + @JsonProperty(value = "scheduleFrequencyInMins") + private Integer scheduleFrequencyInMins; + + /** + * Get frequency of the log schedule operation of this policy in minutes. + * + * @return the scheduleFrequencyInMins value + */ + public Integer scheduleFrequencyInMins() { + return this.scheduleFrequencyInMins; + } + + /** + * Set frequency of the log schedule operation of this policy in minutes. + * + * @param scheduleFrequencyInMins the scheduleFrequencyInMins value to set + * @return the LogSchedulePolicy object itself. + */ + public LogSchedulePolicy withScheduleFrequencyInMins(Integer scheduleFrequencyInMins) { + this.scheduleFrequencyInMins = scheduleFrequencyInMins; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LongTermRetentionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LongTermRetentionPolicy.java new file mode 100644 index 0000000000000..9af0929abab6a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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", defaultImpl = LongTermRetentionPolicy.class) +@JsonTypeName("LongTermRetentionPolicy") +public class LongTermRetentionPolicy extends RetentionPolicy { + /** + * Daily retention schedule of the protection policy. + */ + @JsonProperty(value = "dailySchedule") + private DailyRetentionSchedule dailySchedule; + + /** + * Weekly retention schedule of the protection policy. + */ + @JsonProperty(value = "weeklySchedule") + private WeeklyRetentionSchedule weeklySchedule; + + /** + * Monthly retention schedule of the protection policy. + */ + @JsonProperty(value = "monthlySchedule") + private MonthlyRetentionSchedule monthlySchedule; + + /** + * Yearly retention schedule of the protection policy. + */ + @JsonProperty(value = "yearlySchedule") + private YearlyRetentionSchedule yearlySchedule; + + /** + * Get daily retention schedule of the protection policy. + * + * @return the dailySchedule value + */ + public DailyRetentionSchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set daily retention schedule of the protection 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 protection policy. + * + * @return the weeklySchedule value + */ + public WeeklyRetentionSchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set weekly retention schedule of the protection 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 protection policy. + * + * @return the monthlySchedule value + */ + public MonthlyRetentionSchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set monthly retention schedule of the protection 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 protection policy. + * + * @return the yearlySchedule value + */ + public YearlyRetentionSchedule yearlySchedule() { + return this.yearlySchedule; + } + + /** + * Set yearly retention schedule of the protection 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LongTermSchedulePolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/LongTermSchedulePolicy.java new file mode 100644 index 0000000000000..e42d81b7c742b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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", defaultImpl = LongTermSchedulePolicy.class) +@JsonTypeName("LongTermSchedulePolicy") +public class LongTermSchedulePolicy extends SchedulePolicy { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MABContainerHealthDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MABContainerHealthDetails.java new file mode 100644 index 0000000000000..fd64728845b67 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MABContainerHealthDetails.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * MAB workload-specific Health Details. + */ +public class MABContainerHealthDetails { + /** + * Health Code. + */ + @JsonProperty(value = "code") + private Integer code; + + /** + * Health Title. + */ + @JsonProperty(value = "title") + private String title; + + /** + * Health Message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Health Recommended Actions. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get health Code. + * + * @return the code value + */ + public Integer code() { + return this.code; + } + + /** + * Set health Code. + * + * @param code the code value to set + * @return the MABContainerHealthDetails object itself. + */ + public MABContainerHealthDetails withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get health Title. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Set health Title. + * + * @param title the title value to set + * @return the MABContainerHealthDetails object itself. + */ + public MABContainerHealthDetails withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get health Message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set health Message. + * + * @param message the message value to set + * @return the MABContainerHealthDetails object itself. + */ + public MABContainerHealthDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get health Recommended Actions. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set health Recommended Actions. + * + * @param recommendations the recommendations value to set + * @return the MABContainerHealthDetails object itself. + */ + public MABContainerHealthDetails withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabContainer.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabContainer.java new file mode 100644 index 0000000000000..efc4930fbb579 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabContainer.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.ProtectionContainerInner; + +/** + * Container with items backed up using MAB backup engine. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = MabContainer.class) +@JsonTypeName("Windows") +public class MabContainer extends ProtectionContainerInner { + /** + * Can the container be registered one more time. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /** + * ContainerID represents the container. + */ + @JsonProperty(value = "containerId") + private Long containerId; + + /** + * Number of items backed up in this container. + */ + @JsonProperty(value = "protectedItemCount") + private Long protectedItemCount; + + /** + * Agent version of this container. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /** + * Additional information for this container. + */ + @JsonProperty(value = "extendedInfo") + private MabContainerExtendedInfo extendedInfo; + + /** + * Health details on this mab container. + */ + @JsonProperty(value = "mabContainerHealthDetails") + private List mabContainerHealthDetails; + + /** + * Health state of mab container. + */ + @JsonProperty(value = "containerHealthState") + private String containerHealthState; + + /** + * Get can the container be registered one more time. + * + * @return the canReRegister value + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set can the container 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 containerID represents the container. + * + * @return the containerId value + */ + public Long containerId() { + return this.containerId; + } + + /** + * Set containerID represents 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 number of items backed up in this container. + * + * @return the protectedItemCount value + */ + public Long protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set number of items backed up in this container. + * + * @param protectedItemCount the protectedItemCount value to set + * @return the MabContainer object itself. + */ + public MabContainer withProtectedItemCount(Long protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get agent version of this container. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set agent version of 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 this container. + * + * @return the extendedInfo value + */ + public MabContainerExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for this container. + * + * @param extendedInfo the extendedInfo value to set + * @return the MabContainer object itself. + */ + public MabContainer withExtendedInfo(MabContainerExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + + /** + * Get health details on this mab container. + * + * @return the mabContainerHealthDetails value + */ + public List mabContainerHealthDetails() { + return this.mabContainerHealthDetails; + } + + /** + * Set health details on this mab container. + * + * @param mabContainerHealthDetails the mabContainerHealthDetails value to set + * @return the MabContainer object itself. + */ + public MabContainer withMabContainerHealthDetails(List mabContainerHealthDetails) { + this.mabContainerHealthDetails = mabContainerHealthDetails; + return this; + } + + /** + * Get health state of mab container. + * + * @return the containerHealthState value + */ + public String containerHealthState() { + return this.containerHealthState; + } + + /** + * Set health state of mab container. + * + * @param containerHealthState the containerHealthState value to set + * @return the MabContainer object itself. + */ + public MabContainer withContainerHealthState(String containerHealthState) { + this.containerHealthState = containerHealthState; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabContainerExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabContainerExtendedInfo.java new file mode 100644 index 0000000000000..29a541b7ae32f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabContainerExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information of the container. + */ +public class MabContainerExtendedInfo { + /** + * Time stamp when this container was refreshed. + */ + @JsonProperty(value = "lastRefreshedAt") + private DateTime lastRefreshedAt; + + /** + * Type of backup items associated with this container. Possible values + * include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + * 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + * 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', + * 'SAPAseDatabase'. + */ + @JsonProperty(value = "backupItemType") + private BackupItemType backupItemType; + + /** + * List of backup items associated with this container. + */ + @JsonProperty(value = "backupItems") + private List backupItems; + + /** + * Backup policy associated with this container. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Latest backup status of this container. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * Get time stamp when this container was refreshed. + * + * @return the lastRefreshedAt value + */ + public DateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set 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 type of backup items associated with this container. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the backupItemType value + */ + public BackupItemType backupItemType() { + return this.backupItemType; + } + + /** + * Set type of backup items associated with this container. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param backupItemType the backupItemType value to set + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withBackupItemType(BackupItemType backupItemType) { + this.backupItemType = backupItemType; + return this; + } + + /** + * Get list of backup items associated with this container. + * + * @return the backupItems value + */ + public List backupItems() { + return this.backupItems; + } + + /** + * Set 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 backup policy associated with this container. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set 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 latest backup status of this container. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabErrorInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabErrorInfo.java new file mode 100644 index 0000000000000..466a8931e344b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabErrorInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * MAB workload-specific error information. + */ +public class MabErrorInfo { + /** + * Localized error string. + */ + @JsonProperty(value = "errorString", access = JsonProperty.Access.WRITE_ONLY) + private String errorString; + + /** + * List of localized recommendations. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get localized error string. + * + * @return the errorString value + */ + public String errorString() { + return this.errorString; + } + + /** + * Get list of localized recommendations. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabFileFolderProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabFileFolderProtectedItem.java new file mode 100644 index 0000000000000..9d052c3e6bfdc --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabFileFolderProtectedItem.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * MAB workload-specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = MabFileFolderProtectedItem.class) +@JsonTypeName("MabFileFolderProtectedItem") +public class MabFileFolderProtectedItem extends ProtectedItem { + /** + * Friendly name of this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Name of the computer associated with this backup item. + */ + @JsonProperty(value = "computerName") + private String computerName; + + /** + * Status of last backup operation. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * Timestamp of the last backup operation on this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private DateTime lastBackupTime; + + /** + * Protected, ProtectionStopped, IRPending or ProtectionError. + */ + @JsonProperty(value = "protectionState") + private String protectionState; + + /** + * Sync time for deferred deletion in UTC. + */ + @JsonProperty(value = "deferredDeleteSyncTimeInUTC") + private Long deferredDeleteSyncTimeInUTC; + + /** + * Additional information with this backup item. + */ + @JsonProperty(value = "extendedInfo") + private MabFileFolderProtectedItemExtendedInfo extendedInfo; + + /** + * Get friendly name of this backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set 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 name of the computer associated with this backup item. + * + * @return the computerName value + */ + public String computerName() { + return this.computerName; + } + + /** + * Set 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 status of last backup operation. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set 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 timestamp of the last backup operation on this backup item. + * + * @return the lastBackupTime value + */ + public DateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set timestamp of the last backup operation on this backup item. + * + * @param lastBackupTime the lastBackupTime value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withLastBackupTime(DateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get protected, ProtectionStopped, IRPending or ProtectionError. + * + * @return the protectionState value + */ + public String protectionState() { + return this.protectionState; + } + + /** + * Set 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 sync time for deferred deletion in UTC. + * + * @return the deferredDeleteSyncTimeInUTC value + */ + public Long deferredDeleteSyncTimeInUTC() { + return this.deferredDeleteSyncTimeInUTC; + } + + /** + * Set sync time for deferred deletion in UTC. + * + * @param deferredDeleteSyncTimeInUTC the deferredDeleteSyncTimeInUTC value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withDeferredDeleteSyncTimeInUTC(Long deferredDeleteSyncTimeInUTC) { + this.deferredDeleteSyncTimeInUTC = deferredDeleteSyncTimeInUTC; + return this; + } + + /** + * Get additional information with this backup item. + * + * @return the extendedInfo value + */ + public MabFileFolderProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information with 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabFileFolderProtectedItemExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabFileFolderProtectedItemExtendedInfo.java new file mode 100644 index 0000000000000..3a32a98b04764 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information on the backed up item. + */ +public class MabFileFolderProtectedItemExtendedInfo { + /** + * Last time when the agent data synced to service. + */ + @JsonProperty(value = "lastRefreshedAt") + private DateTime lastRefreshedAt; + + /** + * The oldest backup copy available. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * Number of backup copies associated with the backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Get last time when the agent data synced to service. + * + * @return the lastRefreshedAt value + */ + public DateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set last time when the agent data synced to 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 number of backup copies associated with the backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabJob.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabJob.java new file mode 100644 index 0000000000000..764cf59c0460e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabJob.java @@ -0,0 +1,215 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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.v2020_02_02.implementation.JobInner; + +/** + * MAB workload-specific job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType", defaultImpl = MabJob.class) +@JsonTypeName("MabJob") +public class MabJob extends JobInner { + /** + * Time taken by job to run. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * The state/actions applicable on jobs like cancel/retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /** + * Name of server protecting the DS. + */ + @JsonProperty(value = "mabServerName") + private String mabServerName; + + /** + * Server type of MAB container. Possible values include: 'Invalid', + * 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', + * 'AzureBackupServerContainer', 'MABContainer', 'Cluster', + * 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', + * 'SQLAGWorkLoadContainer', 'StorageContainer', 'GenericContainer'. + */ + @JsonProperty(value = "mabServerType") + private MabServerType mabServerType; + + /** + * Workload type of backup item. Possible values include: 'Invalid', 'VM', + * 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + * 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + * 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @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 time taken by job to run. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set time taken by 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/actions applicable on jobs like cancel/retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the state/actions applicable on jobs like cancel/retry. + * + * @param actionsInfo the actionsInfo value to set + * @return the MabJob object itself. + */ + public MabJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get name of server protecting the DS. + * + * @return the mabServerName value + */ + public String mabServerName() { + return this.mabServerName; + } + + /** + * Set name of server protecting the DS. + * + * @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 MAB container. Possible values include: 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', 'AzureBackupServerContainer', 'MABContainer', 'Cluster', 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', 'SQLAGWorkLoadContainer', 'StorageContainer', 'GenericContainer'. + * + * @return the mabServerType value + */ + public MabServerType mabServerType() { + return this.mabServerType; + } + + /** + * Set server type of MAB container. Possible values include: 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', 'AzureBackupServerContainer', 'MABContainer', 'Cluster', 'AzureSqlContainer', 'Windows', 'VCenter', 'VMAppContainer', 'SQLAGWorkLoadContainer', 'StorageContainer', 'GenericContainer'. + * + * @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', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @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', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabJobExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabJobExtendedInfo.java new file mode 100644 index 0000000000000..38277e0611791 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for the MAB 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabJobTaskDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabJobTaskDetails.java new file mode 100644 index 0000000000000..a2cec51ba5d1e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * MAB 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabProtectionPolicy.java new file mode 100644 index 0000000000000..a6a50e4e0d1bf --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabProtectionPolicy.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Mab container-specific backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType", defaultImpl = MabProtectionPolicy.class) +@JsonTypeName("MAB") +public class MabProtectionPolicy extends ProtectionPolicy { + /** + * Backup schedule of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /** + * Retention policy details. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get backup schedule of backup policy. + * + * @return the schedulePolicy value + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set backup schedule of 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 retention policy details. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set retention policy details. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabServerType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MabServerType.java new file mode 100644 index 0000000000000..61d5680a7c3a5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MabServerType. + */ +public final class MabServerType extends ExpandableStringEnum { + /** Static value Invalid for MabServerType. */ + public static final MabServerType INVALID = fromString("Invalid"); + + /** Static value Unknown for MabServerType. */ + public static final MabServerType UNKNOWN = fromString("Unknown"); + + /** Static value IaasVMContainer for MabServerType. */ + public static final MabServerType IAAS_VMCONTAINER = fromString("IaasVMContainer"); + + /** Static value IaasVMServiceContainer for MabServerType. */ + public static final MabServerType IAAS_VMSERVICE_CONTAINER = fromString("IaasVMServiceContainer"); + + /** Static value DPMContainer for MabServerType. */ + public static final MabServerType DPMCONTAINER = fromString("DPMContainer"); + + /** Static value AzureBackupServerContainer for MabServerType. */ + public static final MabServerType AZURE_BACKUP_SERVER_CONTAINER = fromString("AzureBackupServerContainer"); + + /** Static value MABContainer for MabServerType. */ + public static final MabServerType MABCONTAINER = fromString("MABContainer"); + + /** Static value Cluster for MabServerType. */ + public static final MabServerType CLUSTER = fromString("Cluster"); + + /** Static value AzureSqlContainer for MabServerType. */ + public static final MabServerType AZURE_SQL_CONTAINER = fromString("AzureSqlContainer"); + + /** Static value Windows for MabServerType. */ + public static final MabServerType WINDOWS = fromString("Windows"); + + /** Static value VCenter for MabServerType. */ + public static final MabServerType VCENTER = fromString("VCenter"); + + /** Static value VMAppContainer for MabServerType. */ + public static final MabServerType VMAPP_CONTAINER = fromString("VMAppContainer"); + + /** Static value SQLAGWorkLoadContainer for MabServerType. */ + public static final MabServerType SQLAGWORK_LOAD_CONTAINER = fromString("SQLAGWorkLoadContainer"); + + /** Static value StorageContainer for MabServerType. */ + public static final MabServerType STORAGE_CONTAINER = fromString("StorageContainer"); + + /** Static value GenericContainer for MabServerType. */ + public static final MabServerType GENERIC_CONTAINER = fromString("GenericContainer"); + + /** + * Creates or finds a MabServerType from its string representation. + * @param name a name to look for + * @return the corresponding MabServerType + */ + @JsonCreator + public static MabServerType fromString(String name) { + return fromString(name, MabServerType.class); + } + + /** + * @return known MabServerType values + */ + public static Collection values() { + return values(MabServerType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MonthOfYear.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MonthOfYear.java new file mode 100644 index 0000000000000..2f9bfcb4701ef --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MonthlyRetentionSchedule.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/MonthlyRetentionSchedule.java new file mode 100644 index 0000000000000..46185294e8560 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 monthly retention policy. + */ + @JsonProperty(value = "retentionScheduleDaily") + private DailyRetentionFormat retentionScheduleDaily; + + /** + * Weekly retention format for monthly retention policy. + */ + @JsonProperty(value = "retentionScheduleWeekly") + private WeeklyRetentionFormat retentionScheduleWeekly; + + /** + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * Retention duration of 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 monthly retention policy. + * + * @return the retentionScheduleDaily value + */ + public DailyRetentionFormat retentionScheduleDaily() { + return this.retentionScheduleDaily; + } + + /** + * Set daily retention format for 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 monthly retention policy. + * + * @return the retentionScheduleWeekly value + */ + public WeeklyRetentionFormat retentionScheduleWeekly() { + return this.retentionScheduleWeekly; + } + + /** + * Set weekly retention format for 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 retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set retention times of 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 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 MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/NameInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/NameInfo.java new file mode 100644 index 0000000000000..4c82071af3688 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/NameInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name of usage. + */ +public class NameInfo { + /** + * Value of usage. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Localized value of usage. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get value of usage. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of usage. + * + * @param value the value value to set + * @return the NameInfo object itself. + */ + public NameInfo withValue(String value) { + this.value = value; + return this; + } + + /** + * Get localized value of usage. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set localized value of usage. + * + * @param localizedValue the localizedValue value to set + * @return the NameInfo object itself. + */ + public NameInfo withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationResultInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationResultInfo.java new file mode 100644 index 0000000000000..0502a8223fb84 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Operation result info. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = OperationResultInfo.class) +@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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationResultInfoBase.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationResultInfoBase.java new file mode 100644 index 0000000000000..e50588d7f2ba8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for operation result info. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = OperationResultInfoBase.class) +@JsonTypeName("OperationResultInfoBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ExportJobsOperationResultInfo", value = ExportJobsOperationResultInfo.class), + @JsonSubTypes.Type(name = "OperationResultInfo", value = OperationResultInfo.class) +}) +public class OperationResultInfoBase { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationResultInfoBaseResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationResultInfoBaseResource.java new file mode 100644 index 0000000000000..1bedbc6e6bbe0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 operation value. + */ + OperationResultInfoBase operation(); + + /** + * @return the statusCode value. + */ + HttpStatusCode statusCode(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusError.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusError.java new file mode 100644 index 0000000000000..c314a4753d939 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information associated with operation status call. + */ +public class OperationStatusError { + /** + * Error code of the operation failure. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message displayed if the operation failure. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code of the operation failure. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code of the operation failure. + * + * @param code the code value to set + * @return the OperationStatusError object itself. + */ + public OperationStatusError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message displayed if the operation failure. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message displayed if the operation failure. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusExtendedInfo.java new file mode 100644 index 0000000000000..ca906d3b307a5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for additional information of operation status. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = OperationStatusExtendedInfo.class) +@JsonTypeName("OperationStatusExtendedInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "OperationStatusJobExtendedInfo", value = OperationStatusJobExtendedInfo.class), + @JsonSubTypes.Type(name = "OperationStatusJobsExtendedInfo", value = OperationStatusJobsExtendedInfo.class), + @JsonSubTypes.Type(name = "OperationStatusProvisionILRExtendedInfo", value = OperationStatusProvisionILRExtendedInfo.class) +}) +public class OperationStatusExtendedInfo { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusJobExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusJobExtendedInfo.java new file mode 100644 index 0000000000000..5b5904c994c57 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Operation status job extended info. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = OperationStatusJobExtendedInfo.class) +@JsonTypeName("OperationStatusJobExtendedInfo") +public class OperationStatusJobExtendedInfo extends OperationStatusExtendedInfo { + /** + * ID of the job created for this protected item. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /** + * Get iD of the job created for this protected item. + * + * @return the jobId value + */ + public String jobId() { + return this.jobId; + } + + /** + * Set iD of the job created for this protected 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusJobsExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusJobsExtendedInfo.java new file mode 100644 index 0000000000000..f33fb2d7ab39d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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 list of jobs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = OperationStatusJobsExtendedInfo.class) +@JsonTypeName("OperationStatusJobsExtendedInfo") +public class OperationStatusJobsExtendedInfo extends OperationStatusExtendedInfo { + /** + * IDs of the jobs created for the protected 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 protected item. + * + * @return the jobIds value + */ + public List jobIds() { + return this.jobIds; + } + + /** + * Set iDs of the jobs created for the protected 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusProvisionILRExtendedInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusProvisionILRExtendedInfo.java new file mode 100644 index 0000000000000..4be8419ba9f12 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusProvisionILRExtendedInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Operation status extended info for ILR provision action. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = OperationStatusProvisionILRExtendedInfo.class) +@JsonTypeName("OperationStatusProvisionILRExtendedInfo") +public class OperationStatusProvisionILRExtendedInfo extends OperationStatusExtendedInfo { + /** + * Target details for file / folder restore. + */ + @JsonProperty(value = "recoveryTarget") + private InstantItemRecoveryTarget recoveryTarget; + + /** + * Get target details for file / folder restore. + * + * @return the recoveryTarget value + */ + public InstantItemRecoveryTarget recoveryTarget() { + return this.recoveryTarget; + } + + /** + * Set target details for file / 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusValues.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusValues.java new file mode 100644 index 0000000000000..752097f34bd64 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationStatusValues.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationStatusValues. + */ +public final class OperationStatusValues extends ExpandableStringEnum { + /** Static value Invalid for OperationStatusValues. */ + public static final OperationStatusValues INVALID = fromString("Invalid"); + + /** Static value InProgress for OperationStatusValues. */ + public static final OperationStatusValues IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for OperationStatusValues. */ + public static final OperationStatusValues SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OperationStatusValues. */ + public static final OperationStatusValues FAILED = fromString("Failed"); + + /** Static value Canceled for OperationStatusValues. */ + public static final OperationStatusValues CANCELED = fromString("Canceled"); + + /** + * Creates or finds a OperationStatusValues from its string representation. + * @param name a name to look for + * @return the corresponding OperationStatusValues + */ + @JsonCreator + public static OperationStatusValues fromString(String name) { + return fromString(name, OperationStatusValues.class); + } + + /** + * @return known OperationStatusValues values + */ + public static Collection values() { + return values(OperationStatusValues.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationType.java new file mode 100644 index 0000000000000..582513fb8f8c8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperationType. + */ +public final class OperationType extends ExpandableStringEnum { + /** Static value Invalid for OperationType. */ + public static final OperationType INVALID = fromString("Invalid"); + + /** Static value Register for OperationType. */ + public static final OperationType REGISTER = fromString("Register"); + + /** Static value Reregister for OperationType. */ + public static final OperationType REREGISTER = fromString("Reregister"); + + /** + * Creates or finds a OperationType from its string representation. + * @param name a name to look for + * @return the corresponding OperationType + */ + @JsonCreator + public static OperationType fromString(String name) { + return fromString(name, OperationType.class); + } + + /** + * @return known OperationType values + */ + public static Collection values() { + return values(OperationType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationWorkerResponse.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OperationWorkerResponse.java new file mode 100644 index 0000000000000..a1f3dcc860ba5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This is the base class for operation result responses. + */ +public class OperationWorkerResponse { + /** + * 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; + + /** + * HTTP headers associated with this operation. + */ + @JsonProperty(value = "headers") + private Map> headers; + + /** + * Get 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 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 hTTP headers associated with this operation. + * + * @return the headers value + */ + public Map> headers() { + return this.headers; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Operations.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Operations.java new file mode 100644 index 0000000000000..02813e7106dd5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Operations.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateAsync(String vaultName, String resourceGroupName, ValidateOperationRequest parameters); + + /** + * Returns the list of available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OverwriteOptions.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OverwriteOptions.java new file mode 100644 index 0000000000000..d84e704508abe --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/OverwriteOptions.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OverwriteOptions. + */ +public final class OverwriteOptions extends ExpandableStringEnum { + /** Static value Invalid for OverwriteOptions. */ + public static final OverwriteOptions INVALID = fromString("Invalid"); + + /** Static value FailOnConflict for OverwriteOptions. */ + public static final OverwriteOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); + + /** Static value Overwrite for OverwriteOptions. */ + public static final OverwriteOptions OVERWRITE = fromString("Overwrite"); + + /** + * Creates or finds a OverwriteOptions from its string representation. + * @param name a name to look for + * @return the corresponding OverwriteOptions + */ + @JsonCreator + public static OverwriteOptions fromString(String name) { + return fromString(name, OverwriteOptions.class); + } + + /** + * @return known OverwriteOptions values + */ + public static Collection values() { + return values(OverwriteOptions.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PointInTimeRange.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PointInTimeRange.java new file mode 100644 index 0000000000000..cd069a1984222 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PointInTimeRange.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Provides details for log ranges. + */ +public class PointInTimeRange { + /** + * Start time of the time range for log recovery. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * End time of the time range for log recovery. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Get start time of the time range for log recovery. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set start time of the time range for log recovery. + * + * @param startTime the startTime value to set + * @return the PointInTimeRange object itself. + */ + public PointInTimeRange withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get end time of the time range for log recovery. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set end time of the time range for log recovery. + * + * @param endTime the endTime value to set + * @return the PointInTimeRange object itself. + */ + public PointInTimeRange withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PolicyType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PolicyType.java new file mode 100644 index 0000000000000..5a4c7c1001d2e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PolicyType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PolicyType. + */ +public final class PolicyType extends ExpandableStringEnum { + /** Static value Invalid for PolicyType. */ + public static final PolicyType INVALID = fromString("Invalid"); + + /** Static value Full for PolicyType. */ + public static final PolicyType FULL = fromString("Full"); + + /** Static value Differential for PolicyType. */ + public static final PolicyType DIFFERENTIAL = fromString("Differential"); + + /** Static value Log for PolicyType. */ + public static final PolicyType LOG = fromString("Log"); + + /** Static value CopyOnlyFull for PolicyType. */ + public static final PolicyType COPY_ONLY_FULL = fromString("CopyOnlyFull"); + + /** Static value Incremental for PolicyType. */ + public static final PolicyType INCREMENTAL = fromString("Incremental"); + + /** + * Creates or finds a PolicyType from its string representation. + * @param name a name to look for + * @return the corresponding PolicyType + */ + @JsonCreator + public static PolicyType fromString(String name) { + return fromString(name, PolicyType.class); + } + + /** + * @return known PolicyType values + */ + public static Collection values() { + return values(PolicyType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreBackupValidation.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreBackupValidation.java new file mode 100644 index 0000000000000..e03f1fac6f15e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreBackupValidation.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Pre-backup validation for Azure VM Workload provider. + */ +public class PreBackupValidation { + /** + * Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible + * values include: 'Invalid', 'Success', 'Failed'. + */ + @JsonProperty(value = "status") + private InquiryStatus status; + + /** + * Error code of protectable item. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Message corresponding to the error code for the protectable item. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'Invalid', 'Success', 'Failed'. + * + * @return the status value + */ + public InquiryStatus status() { + return this.status; + } + + /** + * Set status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values include: 'Invalid', 'Success', 'Failed'. + * + * @param status the status value to set + * @return the PreBackupValidation object itself. + */ + public PreBackupValidation withStatus(InquiryStatus status) { + this.status = status; + return this; + } + + /** + * Get error code of protectable item. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code of protectable item. + * + * @param code the code value to set + * @return the PreBackupValidation object itself. + */ + public PreBackupValidation withCode(String code) { + this.code = code; + return this; + } + + /** + * Get message corresponding to the error code for the protectable item. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set message corresponding to the error code for the protectable item. + * + * @param message the message value to set + * @return the PreBackupValidation object itself. + */ + public PreBackupValidation withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreValidateEnableBackupRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreValidateEnableBackupRequest.java new file mode 100644 index 0000000000000..8765bb0785658 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreValidateEnableBackupRequest.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contract to validate if backup can be enabled on the given resource in a + * given vault and given configuration. + * It will validate followings + * 1. Vault capacity + * 2. VM is already protected + * 3. Any VM related configuration passed in properties. + */ +public class PreValidateEnableBackupRequest { + /** + * ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values + * include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + * 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', + * 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', + * 'SAPAseDatabase'. + */ + @JsonProperty(value = "resourceType") + private DataSourceType resourceType; + + /** + * ARM Virtual Machine Id. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * ARM id of the Recovery Services Vault. + */ + @JsonProperty(value = "vaultId") + private String vaultId; + + /** + * Configuration of VM if any needs to be validated like OS type etc. + */ + @JsonProperty(value = "properties") + private String properties; + + /** + * Get protectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the resourceType value + */ + public DataSourceType resourceType() { + return this.resourceType; + } + + /** + * Set protectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param resourceType the resourceType value to set + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withResourceType(DataSourceType resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get aRM Virtual Machine Id. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set aRM Virtual Machine Id. + * + * @param resourceId the resourceId value to set + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get aRM id of the Recovery Services Vault. + * + * @return the vaultId value + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Set aRM id of the Recovery Services Vault. + * + * @param vaultId the vaultId value to set + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withVaultId(String vaultId) { + this.vaultId = vaultId; + return this; + } + + /** + * Get configuration of VM if any needs to be validated like OS type etc. + * + * @return the properties value + */ + public String properties() { + return this.properties; + } + + /** + * Set configuration of VM if any needs to be validated like OS type etc. + * + * @param properties the properties value to set + * @return the PreValidateEnableBackupRequest object itself. + */ + public PreValidateEnableBackupRequest withProperties(String properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreValidateEnableBackupResponse.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreValidateEnableBackupResponse.java new file mode 100644 index 0000000000000..5f0f4f80082df --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PreValidateEnableBackupResponse.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.PreValidateEnableBackupResponseInner; + +/** + * Type representing PreValidateEnableBackupResponse. + */ +public interface PreValidateEnableBackupResponse extends HasInner, HasManager { + /** + * @return the containerName value. + */ + String containerName(); + + /** + * @return the errorCode value. + */ + String errorCode(); + + /** + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * @return the protectedItemName value. + */ + String protectedItemName(); + + /** + * @return the recommendation value. + */ + String recommendation(); + + /** + * @return the status value. + */ + ValidationStatus status(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpoint.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpoint.java new file mode 100644 index 0000000000000..6dfde0131646e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpoint.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Private Endpoint network resource that is linked to the Private Endpoint + * connection. + */ +public class PrivateEndpoint { + /** + * Gets or sets id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get gets or sets id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set gets or sets id. + * + * @param id the id value to set + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnectionResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnectionResource.java new file mode 100644 index 0000000000000..078f14b07264e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnectionResource.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.PrivateEndpointConnectionResourceInner; +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.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.PrivateEndpointConnectionInner; + +/** + * Type representing PrivateEndpointConnectionResource. + */ +public interface PrivateEndpointConnectionResource 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. + */ + PrivateEndpointConnectionInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnectionResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVault, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnectionResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnectionResource definition. + */ + interface Blank extends WithVault { + } + + /** + * The stage of the privateendpointconnectionresource definition allowing to specify Vault. + */ + interface WithVault { + /** + * Specifies vaultName, resourceGroupName. + * @param vaultName The name of the recovery services vault + * @param resourceGroupName The name of the resource group where the recovery services vault is present + * @return the next definition stage + */ + WithCreate withExistingVault(String vaultName, String resourceGroupName); + } + + /** + * The stage of the privateendpointconnectionresource definition allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag Optional ETag + * @return the next definition stage + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the privateendpointconnectionresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the privateendpointconnectionresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties PrivateEndpointConnectionResource properties + * @return the next definition stage + */ + WithCreate withProperties(PrivateEndpointConnectionInner properties); + } + + /** + * The stage of the privateendpointconnectionresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the 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.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithTags { + } + } + /** + * The template for a PrivateEndpointConnectionResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithETag, UpdateStages.WithLocation, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of PrivateEndpointConnectionResource update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnectionresource update allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag Optional ETag + * @return the next update stage + */ + Update withETag(String eTag); + } + + /** + * The stage of the privateendpointconnectionresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the privateendpointconnectionresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties PrivateEndpointConnectionResource properties + * @return the next update stage + */ + Update withProperties(PrivateEndpointConnectionInner properties); + } + + /** + * The stage of the privateendpointconnectionresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnectionStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnectionStatus.java new file mode 100644 index 0000000000000..4c8d7c9d2889b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnectionStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointConnectionStatus. + */ +public final class PrivateEndpointConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateEndpointConnectionStatus. */ + public static final PrivateEndpointConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateEndpointConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointConnectionStatus + */ + @JsonCreator + public static PrivateEndpointConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointConnectionStatus.class); + } + + /** + * @return known PrivateEndpointConnectionStatus values + */ + public static Collection values() { + return values(PrivateEndpointConnectionStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnections.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..4f7b119b11ed7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateEndpointConnections.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName); + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateLinkServiceConnectionState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..192ce9ca4a41a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/PrivateLinkServiceConnectionState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Private Link Service Connection State. + */ +public class PrivateLinkServiceConnectionState { + /** + * Gets or sets the status. Possible values include: 'Pending', 'Approved', + * 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private PrivateEndpointConnectionStatus status; + + /** + * Gets or sets description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Gets or sets actions required. + */ + @JsonProperty(value = "actionRequired") + private String actionRequired; + + /** + * Get gets or sets the status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public PrivateEndpointConnectionStatus status() { + return this.status; + } + + /** + * Set gets or sets the status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get gets or sets description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set gets or sets description. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get gets or sets actions required. + * + * @return the actionRequired value + */ + public String actionRequired() { + return this.actionRequired; + } + + /** + * Set gets or sets actions required. + * + * @param actionRequired the actionRequired value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { + this.actionRequired = actionRequired; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectableContainerResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectableContainerResource.java new file mode 100644 index 0000000000000..edb2cb22ce9be --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectableContainerResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectableContainerResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing ProtectableContainerResource. + */ +public interface ProtectableContainerResource 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. + */ + ProtectableContainerInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectableContainers.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectableContainers.java new file mode 100644 index 0000000000000..2b66fdb7ed107 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectableContainers.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectableContainersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectableContainers. + */ +public interface ProtectableContainers extends HasInner { + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String vaultName, final String resourceGroupName, final String fabricName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItem.java new file mode 100644 index 0000000000000..58261242d5324 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItem.java @@ -0,0 +1,382 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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; + +/** + * Base class for backup items. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType", defaultImpl = ProtectedItem.class) +@JsonTypeName("ProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareProtectedItem", value = AzureFileshareProtectedItem.class), + @JsonSubTypes.Type(name = "AzureIaaSVMProtectedItem", value = AzureIaaSVMProtectedItem.class), + @JsonSubTypes.Type(name = "Microsoft.Sql/servers/databases", value = AzureSqlProtectedItem.class), + @JsonSubTypes.Type(name = "AzureVmWorkloadProtectedItem", value = AzureVmWorkloadProtectedItem.class), + @JsonSubTypes.Type(name = "DPMProtectedItem", value = DPMProtectedItem.class), + @JsonSubTypes.Type(name = "GenericProtectedItem", value = GenericProtectedItem.class), + @JsonSubTypes.Type(name = "MabFileFolderProtectedItem", value = MabFileFolderProtectedItem.class) +}) +public class ProtectedItem { + /** + * Type of backup management for the backed up item. Possible values + * include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', + * 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Type of workload this item represents. Possible values include: + * 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + * 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + * 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadType") + private DataSourceType workloadType; + + /** + * Unique name of container. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * ARM ID of the resource to be backed up. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * ID of the backup policy with which this item is backed up. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /** + * Timestamp when the last (latest) backup copy was created for this backup + * item. + */ + @JsonProperty(value = "lastRecoveryPoint") + private DateTime lastRecoveryPoint; + + /** + * Name of the backup set the backup item belongs to. + */ + @JsonProperty(value = "backupSetName") + private String backupSetName; + + /** + * Create mode to indicate recovery of existing soft deleted data source or + * creation of new data source. Possible values include: 'Invalid', + * 'Default', 'Recover'. + */ + @JsonProperty(value = "createMode") + private CreateMode createMode; + + /** + * Time for deferred deletion in UTC. + */ + @JsonProperty(value = "deferredDeleteTimeInUTC") + private DateTime deferredDeleteTimeInUTC; + + /** + * Flag to identify whether the DS is scheduled for deferred delete. + */ + @JsonProperty(value = "isScheduledForDeferredDelete") + private Boolean isScheduledForDeferredDelete; + + /** + * Time remaining before the DS marked for deferred delete is permanently + * deleted. + */ + @JsonProperty(value = "deferredDeleteTimeRemaining") + private String deferredDeleteTimeRemaining; + + /** + * Flag to identify whether the deferred deleted DS is to be purged soon. + */ + @JsonProperty(value = "isDeferredDeleteScheduleUpcoming") + private Boolean isDeferredDeleteScheduleUpcoming; + + /** + * Flag to identify that deferred deleted DS is to be moved into Pause + * state. + */ + @JsonProperty(value = "isRehydrate") + private Boolean isRehydrate; + + /** + * Get type of backup management for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get type of workload this item represents. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workloadType value + */ + public DataSourceType workloadType() { + return this.workloadType; + } + + /** + * Set type of workload this item represents. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workloadType the workloadType value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withWorkloadType(DataSourceType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get unique name of container. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set unique name of container. + * + * @param containerName the containerName value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get aRM ID of the resource to be backed up. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set aRM ID of the resource to be backed up. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get iD of the backup policy with which this item is backed up. + * + * @return the policyId value + */ + public String policyId() { + return this.policyId; + } + + /** + * Set iD of the backup policy with which this item is backed up. + * + * @param policyId the policyId value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get timestamp when the last (latest) backup copy was created for this backup item. + * + * @return the lastRecoveryPoint value + */ + public DateTime lastRecoveryPoint() { + return this.lastRecoveryPoint; + } + + /** + * Set timestamp when the last (latest) backup copy was created for this backup item. + * + * @param lastRecoveryPoint the lastRecoveryPoint value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withLastRecoveryPoint(DateTime lastRecoveryPoint) { + this.lastRecoveryPoint = lastRecoveryPoint; + return this; + } + + /** + * Get name of the backup set the backup item belongs to. + * + * @return the backupSetName value + */ + public String backupSetName() { + return this.backupSetName; + } + + /** + * Set name of the backup set the backup item belongs to. + * + * @param backupSetName the backupSetName value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withBackupSetName(String backupSetName) { + this.backupSetName = backupSetName; + return this; + } + + /** + * Get create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'Invalid', 'Default', 'Recover'. + * + * @return the createMode value + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'Invalid', 'Default', 'Recover'. + * + * @param createMode the createMode value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get time for deferred deletion in UTC. + * + * @return the deferredDeleteTimeInUTC value + */ + public DateTime deferredDeleteTimeInUTC() { + return this.deferredDeleteTimeInUTC; + } + + /** + * Set time for deferred deletion in UTC. + * + * @param deferredDeleteTimeInUTC the deferredDeleteTimeInUTC value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withDeferredDeleteTimeInUTC(DateTime deferredDeleteTimeInUTC) { + this.deferredDeleteTimeInUTC = deferredDeleteTimeInUTC; + return this; + } + + /** + * Get flag to identify whether the DS is scheduled for deferred delete. + * + * @return the isScheduledForDeferredDelete value + */ + public Boolean isScheduledForDeferredDelete() { + return this.isScheduledForDeferredDelete; + } + + /** + * Set flag to identify whether the DS is scheduled for deferred delete. + * + * @param isScheduledForDeferredDelete the isScheduledForDeferredDelete value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + this.isScheduledForDeferredDelete = isScheduledForDeferredDelete; + return this; + } + + /** + * Get time remaining before the DS marked for deferred delete is permanently deleted. + * + * @return the deferredDeleteTimeRemaining value + */ + public String deferredDeleteTimeRemaining() { + return this.deferredDeleteTimeRemaining; + } + + /** + * Set time remaining before the DS marked for deferred delete is permanently deleted. + * + * @param deferredDeleteTimeRemaining the deferredDeleteTimeRemaining value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { + this.deferredDeleteTimeRemaining = deferredDeleteTimeRemaining; + return this; + } + + /** + * Get flag to identify whether the deferred deleted DS is to be purged soon. + * + * @return the isDeferredDeleteScheduleUpcoming value + */ + public Boolean isDeferredDeleteScheduleUpcoming() { + return this.isDeferredDeleteScheduleUpcoming; + } + + /** + * Set flag to identify whether the deferred deleted DS is to be purged soon. + * + * @param isDeferredDeleteScheduleUpcoming the isDeferredDeleteScheduleUpcoming value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { + this.isDeferredDeleteScheduleUpcoming = isDeferredDeleteScheduleUpcoming; + return this; + } + + /** + * Get flag to identify that deferred deleted DS is to be moved into Pause state. + * + * @return the isRehydrate value + */ + public Boolean isRehydrate() { + return this.isRehydrate; + } + + /** + * Set flag to identify that deferred deleted DS is to be moved into Pause state. + * + * @param isRehydrate the isRehydrate value to set + * @return the ProtectedItem object itself. + */ + public ProtectedItem withIsRehydrate(Boolean isRehydrate) { + this.isRehydrate = isRehydrate; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemHealthStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemHealthStatus.java new file mode 100644 index 0000000000000..664dfeccee9fd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemHealthStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProtectedItemHealthStatus. + */ +public final class ProtectedItemHealthStatus extends ExpandableStringEnum { + /** Static value Invalid for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus INVALID = fromString("Invalid"); + + /** Static value Healthy for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus UNHEALTHY = fromString("Unhealthy"); + + /** Static value NotReachable for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus NOT_REACHABLE = fromString("NotReachable"); + + /** Static value IRPending for ProtectedItemHealthStatus. */ + public static final ProtectedItemHealthStatus IRPENDING = fromString("IRPending"); + + /** + * Creates or finds a ProtectedItemHealthStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProtectedItemHealthStatus + */ + @JsonCreator + public static ProtectedItemHealthStatus fromString(String name) { + return fromString(name, ProtectedItemHealthStatus.class); + } + + /** + * @return known ProtectedItemHealthStatus values + */ + public static Collection values() { + return values(ProtectedItemHealthStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemOperationStatuses.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemOperationStatuses.java new file mode 100644 index 0000000000000..919bcf23e1da0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; + +/** + * Type representing ProtectedItemOperationStatuses. + */ +public interface ProtectedItemOperationStatuses { + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemQueryObject.java new file mode 100644 index 0000000000000..ee71c36396854 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemQueryObject.java @@ -0,0 +1,259 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters to list backup items. + */ +public class ProtectedItemQueryObject { + /** + * Health State for the backed up item. Possible values include: 'Passed', + * 'ActionRequired', 'ActionSuggested', 'Invalid'. + */ + @JsonProperty(value = "healthState") + private HealthState healthState; + + /** + * Backup management type for the backed up item. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Type of workload this item represents. Possible values include: + * 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + * 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', + * 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "itemType") + private DataSourceType itemType; + + /** + * Backup policy name associated with the backup item. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Name of the container. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * Backup Engine name. + */ + @JsonProperty(value = "backupEngineName") + private String backupEngineName; + + /** + * Friendly name of protected item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Name of the fabric. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * Name of the backup set. + */ + @JsonProperty(value = "backupSetName") + private String backupSetName; + + /** + * Get health State for the backed up item. Possible values include: 'Passed', 'ActionRequired', 'ActionSuggested', 'Invalid'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set health State for the backed up item. Possible values include: 'Passed', 'ActionRequired', 'ActionSuggested', 'Invalid'. + * + * @param healthState the healthState value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get backup management type for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get type of workload this item represents. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the itemType value + */ + public DataSourceType itemType() { + return this.itemType; + } + + /** + * Set type of workload this item represents. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param itemType the itemType value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withItemType(DataSourceType itemType) { + this.itemType = itemType; + return this; + } + + /** + * Get backup policy name associated with the backup item. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set backup policy name associated with the backup item. + * + * @param policyName the policyName value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get name of the container. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set 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; + } + + /** + * Get backup Engine name. + * + * @return the backupEngineName value + */ + public String backupEngineName() { + return this.backupEngineName; + } + + /** + * Set backup Engine name. + * + * @param backupEngineName the backupEngineName value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withBackupEngineName(String backupEngineName) { + this.backupEngineName = backupEngineName; + return this; + } + + /** + * Get friendly name of protected item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of protected item. + * + * @param friendlyName the friendlyName value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get name of the fabric. + * + * @return the fabricName value + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set name of the fabric. + * + * @param fabricName the fabricName value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get name of the backup set. + * + * @return the backupSetName value + */ + public String backupSetName() { + return this.backupSetName; + } + + /** + * Set name of the backup set. + * + * @param backupSetName the backupSetName value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withBackupSetName(String backupSetName) { + this.backupSetName = backupSetName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemResource.java new file mode 100644 index 0000000000000..5aaa59c949f9c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectedItemResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing ProtectedItemResource. + */ +public interface ProtectedItemResource 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. + */ + ProtectedItem properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemState.java new file mode 100644 index 0000000000000..1ed72f2e6ab94 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectedItemState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProtectedItemState. + */ +public final class ProtectedItemState extends ExpandableStringEnum { + /** Static value Invalid for ProtectedItemState. */ + public static final ProtectedItemState INVALID = fromString("Invalid"); + + /** Static value IRPending for ProtectedItemState. */ + public static final ProtectedItemState IRPENDING = fromString("IRPending"); + + /** Static value Protected for ProtectedItemState. */ + public static final ProtectedItemState PROTECTED = fromString("Protected"); + + /** Static value ProtectionError for ProtectedItemState. */ + public static final ProtectedItemState PROTECTION_ERROR = fromString("ProtectionError"); + + /** Static value ProtectionStopped for ProtectedItemState. */ + public static final ProtectedItemState PROTECTION_STOPPED = fromString("ProtectionStopped"); + + /** Static value ProtectionPaused for ProtectedItemState. */ + public static final ProtectedItemState PROTECTION_PAUSED = fromString("ProtectionPaused"); + + /** + * Creates or finds a ProtectedItemState from its string representation. + * @param name a name to look for + * @return the corresponding ProtectedItemState + */ + @JsonCreator + public static ProtectedItemState fromString(String name) { + return fromString(name, ProtectedItemState.class); + } + + /** + * @return known ProtectedItemState values + */ + public static Collection values() { + return values(ProtectedItemState.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainerBackupFabricVaultProtectionContainerResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainerBackupFabricVaultProtectionContainerResource.java new file mode 100644 index 0000000000000..425ec1ca49999 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainerOperationResults.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainerOperationResults.java new file mode 100644 index 0000000000000..e99ea344b5500 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionContainerOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectionContainerOperationResults. + */ +public interface ProtectionContainerOperationResults extends HasInner { + /** + * Fetches 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainerRefreshOperationResults.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainerRefreshOperationResults.java new file mode 100644 index 0000000000000..9c5d14f6a08c9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainers.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainers.java new file mode 100644 index 0000000000000..b16b3d9d72039 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionContainers.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionContainersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectionContainers. + */ +public interface ProtectionContainers extends SupportsCreating, HasInner { + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable inquireAsync(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * 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 where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To determine + whether the backend service has finished processing the request, call Get Container Operation Result API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable unregisterAsync(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable refreshAsync(String vaultName, String resourceGroupName, String fabricName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntentQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntentQueryObject.java new file mode 100644 index 0000000000000..393082c9cc63d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntentQueryObject.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters to list protection intent. + */ +public class ProtectionIntentQueryObject { + /** + * Backup management type for the backed up item. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Type of workload this item represents. Possible values include: + * 'Invalid', 'SQLInstance', 'SQLAvailabilityGroupContainer'. + */ + @JsonProperty(value = "itemType") + private IntentItemType itemType; + + /** + * Parent name of the intent. + */ + @JsonProperty(value = "parentName") + private String parentName; + + /** + * Item name of the intent. + */ + @JsonProperty(value = "itemName") + private String itemName; + + /** + * Get backup management type for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectionIntentQueryObject object itself. + */ + public ProtectionIntentQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get type of workload this item represents. Possible values include: 'Invalid', 'SQLInstance', 'SQLAvailabilityGroupContainer'. + * + * @return the itemType value + */ + public IntentItemType itemType() { + return this.itemType; + } + + /** + * Set type of workload this item represents. Possible values include: 'Invalid', 'SQLInstance', 'SQLAvailabilityGroupContainer'. + * + * @param itemType the itemType value to set + * @return the ProtectionIntentQueryObject object itself. + */ + public ProtectionIntentQueryObject withItemType(IntentItemType itemType) { + this.itemType = itemType; + return this; + } + + /** + * Get parent name of the intent. + * + * @return the parentName value + */ + public String parentName() { + return this.parentName; + } + + /** + * Set parent name of the intent. + * + * @param parentName the parentName value to set + * @return the ProtectionIntentQueryObject object itself. + */ + public ProtectionIntentQueryObject withParentName(String parentName) { + this.parentName = parentName; + return this; + } + + /** + * Get item name of the intent. + * + * @return the itemName value + */ + public String itemName() { + return this.itemName; + } + + /** + * Set item name of the intent. + * + * @param itemName the itemName value to set + * @return the ProtectionIntentQueryObject object itself. + */ + public ProtectionIntentQueryObject withItemName(String itemName) { + this.itemName = itemName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntentResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntentResource.java new file mode 100644 index 0000000000000..44d9043ed97e9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntentResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionIntentResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing ProtectionIntentResource. + */ +public interface ProtectionIntentResource 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. + */ + ProtectionIntentInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntents.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntents.java new file mode 100644 index 0000000000000..82317f5324397 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionIntents.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionIntentResourceInner; + +/** + * Type representing ProtectionIntents. + */ +public interface ProtectionIntents { + /** + * It will validate followings + 1. Vault capacity + 2. VM is already protected + 3. Any VM related configuration passed in properties. + * + * @param azureRegion Azure region to hit Api + * @param parameters Enable backup validation request on Virtual Machine + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateAsync(String azureRegion, PreValidateEnableBackupRequest parameters); + + /** + * Provides the details of the protection intent up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName); + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters); + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent 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 intentObjectName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicy.java new file mode 100644 index 0000000000000..52b570d1fdb15 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicy.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for backup policy. Workload-specific backup policies are derived + * from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType", defaultImpl = ProtectionPolicy.class) +@JsonTypeName("ProtectionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureWorkload", value = AzureVmWorkloadProtectionPolicy.class), + @JsonSubTypes.Type(name = "AzureStorage", value = AzureFileShareProtectionPolicy.class), + @JsonSubTypes.Type(name = "AzureIaasVM", value = AzureIaaSVMProtectionPolicy.class), + @JsonSubTypes.Type(name = "AzureSql", value = AzureSqlProtectionPolicy.class), + @JsonSubTypes.Type(name = "GenericProtectionPolicy", value = GenericProtectionPolicy.class), + @JsonSubTypes.Type(name = "MAB", value = MabProtectionPolicy.class) +}) +public class ProtectionPolicy { + /** + * Number of items associated with this policy. + */ + @JsonProperty(value = "protectedItemsCount") + private Integer protectedItemsCount; + + /** + * Get number of items associated with this policy. + * + * @return the protectedItemsCount value + */ + public Integer protectedItemsCount() { + return this.protectedItemsCount; + } + + /** + * Set number of items associated with this policy. + * + * @param protectedItemsCount the protectedItemsCount value to set + * @return the ProtectionPolicy object itself. + */ + public ProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { + this.protectedItemsCount = protectedItemsCount; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyOperationStatuses.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyOperationStatuses.java new file mode 100644 index 0000000000000..75592761faf99 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; + +/** + * Type representing ProtectionPolicyOperationStatuses. + */ +public interface ProtectionPolicyOperationStatuses { + /** + * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed + or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some operations + create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyQueryObject.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyQueryObject.java new file mode 100644 index 0000000000000..2af29da901710 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyQueryObject.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters the list backup policies API. + */ +public class ProtectionPolicyQueryObject { + /** + * Backup management type for the backup policy. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Fabric name for filter. + */ + @JsonProperty(value = "fabricName") + private String fabricName; + + /** + * Workload type for the backup policy. Possible values include: 'Invalid', + * 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + * 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', + * 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /** + * Get backup management type for the backup policy. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type for the backup policy. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectionPolicyQueryObject object itself. + */ + public ProtectionPolicyQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get fabric name for filter. + * + * @return the fabricName value + */ + public String fabricName() { + return this.fabricName; + } + + /** + * Set fabric name for filter. + * + * @param fabricName the fabricName value to set + * @return the ProtectionPolicyQueryObject object itself. + */ + public ProtectionPolicyQueryObject withFabricName(String fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get workload type for the backup policy. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @return the workloadType value + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set workload type for the backup policy. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client', 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase'. + * + * @param workloadType the workloadType value to set + * @return the ProtectionPolicyQueryObject object itself. + */ + public ProtectionPolicyQueryObject withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyResource.java new file mode 100644 index 0000000000000..a6310e57032e0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyResource.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for backup policy. Workload-specific backup policies are derived + * from this class. + */ +@SkipParentValidation +public class ProtectionPolicyResource extends Resource { + /** + * ProtectionPolicyResource properties. + */ + @JsonProperty(value = "properties") + private ProtectionPolicy properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get protectionPolicyResource properties. + * + * @return the properties value + */ + public ProtectionPolicy properties() { + return this.properties; + } + + /** + * Set protectionPolicyResource properties. + * + * @param properties the properties value to set + * @return the ProtectionPolicyResource object itself. + */ + public ProtectionPolicyResource withProperties(ProtectionPolicy 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 ProtectionPolicyResource object itself. + */ + public ProtectionPolicyResource withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyResourceList.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyResourceList.java new file mode 100644 index 0000000000000..e865edc813995 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionPolicyResourceList.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of ProtectionPolicy resources. + */ +public class ProtectionPolicyResourceList extends ResourceList { + /** + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of resources. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of resources. + * + * @param value the value value to set + * @return the ProtectionPolicyResourceList object itself. + */ + public ProtectionPolicyResourceList withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionState.java new file mode 100644 index 0000000000000..aad1496f3c6d1 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProtectionState. + */ +public final class ProtectionState extends ExpandableStringEnum { + /** Static value Invalid for ProtectionState. */ + public static final ProtectionState INVALID = fromString("Invalid"); + + /** Static value IRPending for ProtectionState. */ + public static final ProtectionState IRPENDING = fromString("IRPending"); + + /** Static value Protected for ProtectionState. */ + public static final ProtectionState PROTECTED = fromString("Protected"); + + /** Static value ProtectionError for ProtectionState. */ + public static final ProtectionState PROTECTION_ERROR = fromString("ProtectionError"); + + /** Static value ProtectionStopped for ProtectionState. */ + public static final ProtectionState PROTECTION_STOPPED = fromString("ProtectionStopped"); + + /** Static value ProtectionPaused for ProtectionState. */ + public static final ProtectionState PROTECTION_PAUSED = fromString("ProtectionPaused"); + + /** + * Creates or finds a ProtectionState from its string representation. + * @param name a name to look for + * @return the corresponding ProtectionState + */ + @JsonCreator + public static ProtectionState fromString(String name) { + return fromString(name, ProtectionState.class); + } + + /** + * @return known ProtectionState values + */ + public static Collection values() { + return values(ProtectionState.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionStatus.java new file mode 100644 index 0000000000000..a45dc11f71f16 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProtectionStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProtectionStatus. + */ +public final class ProtectionStatus extends ExpandableStringEnum { + /** Static value Invalid for ProtectionStatus. */ + public static final ProtectionStatus INVALID = fromString("Invalid"); + + /** Static value NotProtected for ProtectionStatus. */ + public static final ProtectionStatus NOT_PROTECTED = fromString("NotProtected"); + + /** Static value Protecting for ProtectionStatus. */ + public static final ProtectionStatus PROTECTING = fromString("Protecting"); + + /** Static value Protected for ProtectionStatus. */ + public static final ProtectionStatus PROTECTED = fromString("Protected"); + + /** Static value ProtectionFailed for ProtectionStatus. */ + public static final ProtectionStatus PROTECTION_FAILED = fromString("ProtectionFailed"); + + /** + * Creates or finds a ProtectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding ProtectionStatus + */ + @JsonCreator + public static ProtectionStatus fromString(String name) { + return fromString(name, ProtectionStatus.class); + } + + /** + * @return known ProtectionStatus values + */ + public static Collection values() { + return values(ProtectionStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProvisioningState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProvisioningState.java new file mode 100644 index 0000000000000..782e1313f8cb7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ProvisioningState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Pending for ProvisioningState. */ + public static final ProvisioningState PENDING = fromString("Pending"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryMode.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryMode.java new file mode 100644 index 0000000000000..f230592abe2d5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryMode.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RecoveryMode. + */ +public final class RecoveryMode extends ExpandableStringEnum { + /** Static value Invalid for RecoveryMode. */ + public static final RecoveryMode INVALID = fromString("Invalid"); + + /** Static value FileRecovery for RecoveryMode. */ + public static final RecoveryMode FILE_RECOVERY = fromString("FileRecovery"); + + /** Static value WorkloadRecovery for RecoveryMode. */ + public static final RecoveryMode WORKLOAD_RECOVERY = fromString("WorkloadRecovery"); + + /** + * Creates or finds a RecoveryMode from its string representation. + * @param name a name to look for + * @return the corresponding RecoveryMode + */ + @JsonCreator + public static RecoveryMode fromString(String name) { + return fromString(name, RecoveryMode.class); + } + + /** + * @return known RecoveryMode values + */ + public static Collection values() { + return values(RecoveryMode.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPoint.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPoint.java new file mode 100644 index 0000000000000..7ac1dcfaa790f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPoint.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * 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", defaultImpl = RecoveryPoint.class) +@JsonTypeName("RecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareRecoveryPoint", value = AzureFileShareRecoveryPoint.class), + @JsonSubTypes.Type(name = "GenericRecoveryPoint", value = GenericRecoveryPoint.class), + @JsonSubTypes.Type(name = "IaasVMRecoveryPoint", value = IaasVMRecoveryPoint.class) +}) +public class RecoveryPoint { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointDiskConfiguration.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointDiskConfiguration.java new file mode 100644 index 0000000000000..cfe9443901e39 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointDiskConfiguration.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Disk configuration. + */ +public class RecoveryPointDiskConfiguration { + /** + * Number of disks included in backup. + */ + @JsonProperty(value = "numberOfDisksIncludedInBackup") + private Integer numberOfDisksIncludedInBackup; + + /** + * Number of disks attached to the VM. + */ + @JsonProperty(value = "numberOfDisksAttachedToVm") + private Integer numberOfDisksAttachedToVm; + + /** + * Information of disks included in backup. + */ + @JsonProperty(value = "includedDiskList") + private List includedDiskList; + + /** + * Information of disks excluded from backup. + */ + @JsonProperty(value = "excludedDiskList") + private List excludedDiskList; + + /** + * Get number of disks included in backup. + * + * @return the numberOfDisksIncludedInBackup value + */ + public Integer numberOfDisksIncludedInBackup() { + return this.numberOfDisksIncludedInBackup; + } + + /** + * Set number of disks included in backup. + * + * @param numberOfDisksIncludedInBackup the numberOfDisksIncludedInBackup value to set + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withNumberOfDisksIncludedInBackup(Integer numberOfDisksIncludedInBackup) { + this.numberOfDisksIncludedInBackup = numberOfDisksIncludedInBackup; + return this; + } + + /** + * Get number of disks attached to the VM. + * + * @return the numberOfDisksAttachedToVm value + */ + public Integer numberOfDisksAttachedToVm() { + return this.numberOfDisksAttachedToVm; + } + + /** + * Set number of disks attached to the VM. + * + * @param numberOfDisksAttachedToVm the numberOfDisksAttachedToVm value to set + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withNumberOfDisksAttachedToVm(Integer numberOfDisksAttachedToVm) { + this.numberOfDisksAttachedToVm = numberOfDisksAttachedToVm; + return this; + } + + /** + * Get information of disks included in backup. + * + * @return the includedDiskList value + */ + public List includedDiskList() { + return this.includedDiskList; + } + + /** + * Set information of disks included in backup. + * + * @param includedDiskList the includedDiskList value to set + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withIncludedDiskList(List includedDiskList) { + this.includedDiskList = includedDiskList; + return this; + } + + /** + * Get information of disks excluded from backup. + * + * @return the excludedDiskList value + */ + public List excludedDiskList() { + return this.excludedDiskList; + } + + /** + * Set information of disks excluded from backup. + * + * @param excludedDiskList the excludedDiskList value to set + * @return the RecoveryPointDiskConfiguration object itself. + */ + public RecoveryPointDiskConfiguration withExcludedDiskList(List excludedDiskList) { + this.excludedDiskList = excludedDiskList; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointResource.java new file mode 100644 index 0000000000000..e510d011862b2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointResource.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for backup copies. Workload-specific backup copies are derived + * from this class. + */ +@SkipParentValidation +public class RecoveryPointResource extends Resource { + /** + * RecoveryPointResource properties. + */ + @JsonProperty(value = "properties") + private RecoveryPoint properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get recoveryPointResource properties. + * + * @return the properties value + */ + public RecoveryPoint properties() { + return this.properties; + } + + /** + * Set recoveryPointResource properties. + * + * @param properties the properties value to set + * @return the RecoveryPointResource object itself. + */ + public RecoveryPointResource withProperties(RecoveryPoint 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 RecoveryPointResource object itself. + */ + public RecoveryPointResource withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointResourceList.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointResourceList.java new file mode 100644 index 0000000000000..45e5b423c58f0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointResourceList.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of RecoveryPoint resources. + */ +public class RecoveryPointResourceList extends ResourceList { + /** + * List of resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of resources. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of resources. + * + * @param value the value value to set + * @return the RecoveryPointResourceList object itself. + */ + public RecoveryPointResourceList withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierInformation.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierInformation.java new file mode 100644 index 0000000000000..130fb121230c2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierInformation.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Recovery point tier information. + */ +public class RecoveryPointTierInformation { + /** + * Recovery point tier type. Possible values include: 'Invalid', + * 'InstantRP', 'HardenedRP'. + */ + @JsonProperty(value = "type") + private RecoveryPointTierType type; + + /** + * Recovery point tier status. Possible values include: 'Invalid', 'Valid', + * 'Disabled', 'Deleted'. + */ + @JsonProperty(value = "status") + private RecoveryPointTierStatus status; + + /** + * Get recovery point tier type. Possible values include: 'Invalid', 'InstantRP', 'HardenedRP'. + * + * @return the type value + */ + public RecoveryPointTierType type() { + return this.type; + } + + /** + * Set recovery point tier type. Possible values include: 'Invalid', 'InstantRP', 'HardenedRP'. + * + * @param type the type value to set + * @return the RecoveryPointTierInformation object itself. + */ + public RecoveryPointTierInformation withType(RecoveryPointTierType type) { + this.type = type; + return this; + } + + /** + * Get recovery point tier status. Possible values include: 'Invalid', 'Valid', 'Disabled', 'Deleted'. + * + * @return the status value + */ + public RecoveryPointTierStatus status() { + return this.status; + } + + /** + * Set recovery point tier status. Possible values include: 'Invalid', 'Valid', 'Disabled', 'Deleted'. + * + * @param status the status value to set + * @return the RecoveryPointTierInformation object itself. + */ + public RecoveryPointTierInformation withStatus(RecoveryPointTierStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierStatus.java new file mode 100644 index 0000000000000..182827fa22d96 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RecoveryPointTierStatus. + */ +public enum RecoveryPointTierStatus { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Valid. */ + VALID("Valid"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Deleted. */ + DELETED("Deleted"); + + /** The actual serialized value for a RecoveryPointTierStatus instance. */ + private String value; + + RecoveryPointTierStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecoveryPointTierStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed RecoveryPointTierStatus object, or null if unable to parse. + */ + @JsonCreator + public static RecoveryPointTierStatus fromString(String value) { + RecoveryPointTierStatus[] items = RecoveryPointTierStatus.values(); + for (RecoveryPointTierStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierType.java new file mode 100644 index 0000000000000..ac165e4a9f6e5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryPointTierType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RecoveryPointTierType. + */ +public enum RecoveryPointTierType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value InstantRP. */ + INSTANT_RP("InstantRP"), + + /** Enum value HardenedRP. */ + HARDENED_RP("HardenedRP"); + + /** The actual serialized value for a RecoveryPointTierType instance. */ + private String value; + + RecoveryPointTierType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecoveryPointTierType instance. + * + * @param value the serialized value to parse. + * @return the parsed RecoveryPointTierType object, or null if unable to parse. + */ + @JsonCreator + public static RecoveryPointTierType fromString(String value) { + RecoveryPointTierType[] items = RecoveryPointTierType.values(); + for (RecoveryPointTierType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryType.java new file mode 100644 index 0000000000000..2904064258007 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RecoveryType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RecoveryType. + */ +public final class RecoveryType extends ExpandableStringEnum { + /** Static value Invalid for RecoveryType. */ + public static final RecoveryType INVALID = fromString("Invalid"); + + /** Static value OriginalLocation for RecoveryType. */ + public static final RecoveryType ORIGINAL_LOCATION = fromString("OriginalLocation"); + + /** Static value AlternateLocation for RecoveryType. */ + public static final RecoveryType ALTERNATE_LOCATION = fromString("AlternateLocation"); + + /** Static value RestoreDisks for RecoveryType. */ + public static final RecoveryType RESTORE_DISKS = fromString("RestoreDisks"); + + /** Static value Offline for RecoveryType. */ + public static final RecoveryType OFFLINE = fromString("Offline"); + + /** + * Creates or finds a RecoveryType from its string representation. + * @param name a name to look for + * @return the corresponding RecoveryType + */ + @JsonCreator + public static RecoveryType fromString(String name) { + return fromString(name, RecoveryType.class); + } + + /** + * @return known RecoveryType values + */ + public static Collection values() { + return values(RecoveryType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceHealthDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceHealthDetails.java new file mode 100644 index 0000000000000..aa919204774f9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceHealthDetails.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Health Details for backup items. + */ +public class ResourceHealthDetails { + /** + * Health Code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private Integer code; + + /** + * Health Title. + */ + @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /** + * Health Message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Health Recommended Actions. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * Get health Code. + * + * @return the code value + */ + public Integer code() { + return this.code; + } + + /** + * Get health Title. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Get health Message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get health Recommended Actions. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceHealthStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceHealthStatus.java new file mode 100644 index 0000000000000..88094a06fce06 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceHealthStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ResourceHealthStatus. + */ +public final class ResourceHealthStatus extends ExpandableStringEnum { + /** Static value Healthy for ResourceHealthStatus. */ + public static final ResourceHealthStatus HEALTHY = fromString("Healthy"); + + /** Static value TransientDegraded for ResourceHealthStatus. */ + public static final ResourceHealthStatus TRANSIENT_DEGRADED = fromString("TransientDegraded"); + + /** Static value PersistentDegraded for ResourceHealthStatus. */ + public static final ResourceHealthStatus PERSISTENT_DEGRADED = fromString("PersistentDegraded"); + + /** Static value TransientUnhealthy for ResourceHealthStatus. */ + public static final ResourceHealthStatus TRANSIENT_UNHEALTHY = fromString("TransientUnhealthy"); + + /** Static value PersistentUnhealthy for ResourceHealthStatus. */ + public static final ResourceHealthStatus PERSISTENT_UNHEALTHY = fromString("PersistentUnhealthy"); + + /** Static value Invalid for ResourceHealthStatus. */ + public static final ResourceHealthStatus INVALID = fromString("Invalid"); + + /** + * Creates or finds a ResourceHealthStatus from its string representation. + * @param name a name to look for + * @return the corresponding ResourceHealthStatus + */ + @JsonCreator + public static ResourceHealthStatus fromString(String name) { + return fromString(name, ResourceHealthStatus.class); + } + + /** + * @return known ResourceHealthStatus values + */ + public static Collection values() { + return values(ResourceHealthStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceList.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ResourceList.java new file mode 100644 index 0000000000000..dc6106deee22f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base for all lists of resources. + */ +public class ResourceList { + /** + * The uri to fetch the next page of resources. Call ListNext() fetches + * next page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the uri to fetch the next page of resources. Call ListNext() fetches 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreFileSpecs.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreFileSpecs.java new file mode 100644 index 0000000000000..f7f7db53c55d4 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreFileSpecs.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Restore file specs like file path, type and target folder path info. + */ +public class RestoreFileSpecs { + /** + * Source File/Folder path. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Indicates what the Path variable stands for. + */ + @JsonProperty(value = "fileSpecType") + private String fileSpecType; + + /** + * Destination folder path in target FileShare. + */ + @JsonProperty(value = "targetFolderPath") + private String targetFolderPath; + + /** + * Get source File/Folder path. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set source File/Folder path. + * + * @param path the path value to set + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withPath(String path) { + this.path = path; + return this; + } + + /** + * Get indicates what the Path variable stands for. + * + * @return the fileSpecType value + */ + public String fileSpecType() { + return this.fileSpecType; + } + + /** + * Set indicates what the Path variable stands for. + * + * @param fileSpecType the fileSpecType value to set + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withFileSpecType(String fileSpecType) { + this.fileSpecType = fileSpecType; + return this; + } + + /** + * Get destination folder path in target FileShare. + * + * @return the targetFolderPath value + */ + public String targetFolderPath() { + return this.targetFolderPath; + } + + /** + * Set destination folder path in target FileShare. + * + * @param targetFolderPath the targetFolderPath value to set + * @return the RestoreFileSpecs object itself. + */ + public RestoreFileSpecs withTargetFolderPath(String targetFolderPath) { + this.targetFolderPath = targetFolderPath; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestorePointQueryType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestorePointQueryType.java new file mode 100644 index 0000000000000..dbfcae4784bfd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestorePointQueryType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RestorePointQueryType. + */ +public final class RestorePointQueryType extends ExpandableStringEnum { + /** Static value Invalid for RestorePointQueryType. */ + public static final RestorePointQueryType INVALID = fromString("Invalid"); + + /** Static value Full for RestorePointQueryType. */ + public static final RestorePointQueryType FULL = fromString("Full"); + + /** Static value Log for RestorePointQueryType. */ + public static final RestorePointQueryType LOG = fromString("Log"); + + /** Static value Differential for RestorePointQueryType. */ + public static final RestorePointQueryType DIFFERENTIAL = fromString("Differential"); + + /** Static value FullAndDifferential for RestorePointQueryType. */ + public static final RestorePointQueryType FULL_AND_DIFFERENTIAL = fromString("FullAndDifferential"); + + /** Static value All for RestorePointQueryType. */ + public static final RestorePointQueryType ALL = fromString("All"); + + /** Static value Incremental for RestorePointQueryType. */ + public static final RestorePointQueryType INCREMENTAL = fromString("Incremental"); + + /** + * Creates or finds a RestorePointQueryType from its string representation. + * @param name a name to look for + * @return the corresponding RestorePointQueryType + */ + @JsonCreator + public static RestorePointQueryType fromString(String name) { + return fromString(name, RestorePointQueryType.class); + } + + /** + * @return known RestorePointQueryType values + */ + public static Collection values() { + return values(RestorePointQueryType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequest.java new file mode 100644 index 0000000000000..f56ae536a176b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequest.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for restore request. Workload-specific restore requests are + * derived from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = RestoreRequest.class) +@JsonTypeName("RestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShareRestoreRequest", value = AzureFileShareRestoreRequest.class), + @JsonSubTypes.Type(name = "AzureWorkloadRestoreRequest", value = AzureWorkloadRestoreRequest.class), + @JsonSubTypes.Type(name = "IaasVMRestoreRequest", value = IaasVMRestoreRequest.class) +}) +public class RestoreRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequestResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequestResource.java new file mode 100644 index 0000000000000..910967d9d24e8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequestResource.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for restore request. Workload-specific restore requests are + * derived from this class. + */ +@SkipParentValidation +public class RestoreRequestResource extends Resource { + /** + * RestoreRequestResource properties. + */ + @JsonProperty(value = "properties") + private RestoreRequest properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get restoreRequestResource properties. + * + * @return the properties value + */ + public RestoreRequest properties() { + return this.properties; + } + + /** + * Set restoreRequestResource properties. + * + * @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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequestType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequestType.java new file mode 100644 index 0000000000000..541c59dc40a80 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RestoreRequestType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RestoreRequestType. + */ +public final class RestoreRequestType extends ExpandableStringEnum { + /** Static value Invalid for RestoreRequestType. */ + public static final RestoreRequestType INVALID = fromString("Invalid"); + + /** Static value FullShareRestore for RestoreRequestType. */ + public static final RestoreRequestType FULL_SHARE_RESTORE = fromString("FullShareRestore"); + + /** Static value ItemLevelRestore for RestoreRequestType. */ + public static final RestoreRequestType ITEM_LEVEL_RESTORE = fromString("ItemLevelRestore"); + + /** + * Creates or finds a RestoreRequestType from its string representation. + * @param name a name to look for + * @return the corresponding RestoreRequestType + */ + @JsonCreator + public static RestoreRequestType fromString(String name) { + return fromString(name, RestoreRequestType.class); + } + + /** + * @return known RestoreRequestType values + */ + public static Collection values() { + return values(RestoreRequestType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionDuration.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionDuration.java new file mode 100644 index 0000000000000..49ce1feb92e1e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Retention duration. + */ +public class RetentionDuration { + /** + * Count of duration types. Retention duration is obtained by the counting + * the duration type Count times. + * For example, when Count = 3 and DurationType = Weeks, retention duration + * will be three weeks. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Retention duration type of retention policy. Possible values include: + * 'Invalid', 'Days', 'Weeks', 'Months', 'Years'. + */ + @JsonProperty(value = "durationType") + private RetentionDurationType durationType; + + /** + * Get count of duration types. Retention duration is obtained by the counting the duration type Count times. + For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set count of duration types. Retention duration is obtained by the counting the duration type Count times. + For example, when Count = 3 and DurationType = Weeks, retention duration will be 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 retention duration type of retention policy. Possible values include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years'. + * + * @return the durationType value + */ + public RetentionDurationType durationType() { + return this.durationType; + } + + /** + * Set retention duration type of 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionDurationType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionDurationType.java new file mode 100644 index 0000000000000..3facd8459a9f7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionDurationType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RetentionDurationType. + */ +public final class RetentionDurationType extends ExpandableStringEnum { + /** Static value Invalid for RetentionDurationType. */ + public static final RetentionDurationType INVALID = fromString("Invalid"); + + /** Static value Days for RetentionDurationType. */ + public static final RetentionDurationType DAYS = fromString("Days"); + + /** Static value Weeks for RetentionDurationType. */ + public static final RetentionDurationType WEEKS = fromString("Weeks"); + + /** Static value Months for RetentionDurationType. */ + public static final RetentionDurationType MONTHS = fromString("Months"); + + /** Static value Years for RetentionDurationType. */ + public static final RetentionDurationType YEARS = fromString("Years"); + + /** + * Creates or finds a RetentionDurationType from its string representation. + * @param name a name to look for + * @return the corresponding RetentionDurationType + */ + @JsonCreator + public static RetentionDurationType fromString(String name) { + return fromString(name, RetentionDurationType.class); + } + + /** + * @return known RetentionDurationType values + */ + public static Collection values() { + return values(RetentionDurationType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionPolicy.java new file mode 100644 index 0000000000000..453e3745f33f6 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for retention policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "retentionPolicyType", defaultImpl = RetentionPolicy.class) +@JsonTypeName("RetentionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "LongTermRetentionPolicy", value = LongTermRetentionPolicy.class), + @JsonSubTypes.Type(name = "SimpleRetentionPolicy", value = SimpleRetentionPolicy.class) +}) +public class RetentionPolicy { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionScheduleFormat.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionScheduleFormat.java new file mode 100644 index 0000000000000..92c0ba0e8b878 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/RetentionScheduleFormat.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RetentionScheduleFormat. + */ +public final class RetentionScheduleFormat extends ExpandableStringEnum { + /** Static value Invalid for RetentionScheduleFormat. */ + public static final RetentionScheduleFormat INVALID = fromString("Invalid"); + + /** Static value Daily for RetentionScheduleFormat. */ + public static final RetentionScheduleFormat DAILY = fromString("Daily"); + + /** Static value Weekly for RetentionScheduleFormat. */ + public static final RetentionScheduleFormat WEEKLY = fromString("Weekly"); + + /** + * Creates or finds a RetentionScheduleFormat from its string representation. + * @param name a name to look for + * @return the corresponding RetentionScheduleFormat + */ + @JsonCreator + public static RetentionScheduleFormat fromString(String name) { + return fromString(name, RetentionScheduleFormat.class); + } + + /** + * @return known RetentionScheduleFormat values + */ + public static Collection values() { + return values(RetentionScheduleFormat.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectory.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectory.java new file mode 100644 index 0000000000000..85a6f24c91fb8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectory.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SQLDataDirectory info. + */ +public class SQLDataDirectory { + /** + * Type of data directory mapping. Possible values include: 'Invalid', + * 'Data', 'Log'. + */ + @JsonProperty(value = "type") + private SQLDataDirectoryType type; + + /** + * File path. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Logical name of the file. + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /** + * Get type of data directory mapping. Possible values include: 'Invalid', 'Data', 'Log'. + * + * @return the type value + */ + public SQLDataDirectoryType type() { + return this.type; + } + + /** + * Set type of data directory mapping. Possible values include: 'Invalid', 'Data', 'Log'. + * + * @param type the type value to set + * @return the SQLDataDirectory object itself. + */ + public SQLDataDirectory withType(SQLDataDirectoryType type) { + this.type = type; + return this; + } + + /** + * Get file path. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set file path. + * + * @param path the path value to set + * @return the SQLDataDirectory object itself. + */ + public SQLDataDirectory withPath(String path) { + this.path = path; + return this; + } + + /** + * Get logical name of the file. + * + * @return the logicalName value + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set logical name of the file. + * + * @param logicalName the logicalName value to set + * @return the SQLDataDirectory object itself. + */ + public SQLDataDirectory withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectoryMapping.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectoryMapping.java new file mode 100644 index 0000000000000..16b98677988ed --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectoryMapping.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Encapsulates information regarding data directory. + */ +public class SQLDataDirectoryMapping { + /** + * Type of data directory mapping. Possible values include: 'Invalid', + * 'Data', 'Log'. + */ + @JsonProperty(value = "mappingType") + private SQLDataDirectoryType mappingType; + + /** + * Restore source logical name path. + */ + @JsonProperty(value = "sourceLogicalName") + private String sourceLogicalName; + + /** + * Restore source path. + */ + @JsonProperty(value = "sourcePath") + private String sourcePath; + + /** + * Target path. + */ + @JsonProperty(value = "targetPath") + private String targetPath; + + /** + * Get type of data directory mapping. Possible values include: 'Invalid', 'Data', 'Log'. + * + * @return the mappingType value + */ + public SQLDataDirectoryType mappingType() { + return this.mappingType; + } + + /** + * Set type of data directory mapping. Possible values include: 'Invalid', 'Data', 'Log'. + * + * @param mappingType the mappingType value to set + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withMappingType(SQLDataDirectoryType mappingType) { + this.mappingType = mappingType; + return this; + } + + /** + * Get restore source logical name path. + * + * @return the sourceLogicalName value + */ + public String sourceLogicalName() { + return this.sourceLogicalName; + } + + /** + * Set restore source logical name path. + * + * @param sourceLogicalName the sourceLogicalName value to set + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withSourceLogicalName(String sourceLogicalName) { + this.sourceLogicalName = sourceLogicalName; + return this; + } + + /** + * Get restore source path. + * + * @return the sourcePath value + */ + public String sourcePath() { + return this.sourcePath; + } + + /** + * Set restore source path. + * + * @param sourcePath the sourcePath value to set + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + return this; + } + + /** + * Get target path. + * + * @return the targetPath value + */ + public String targetPath() { + return this.targetPath; + } + + /** + * Set target path. + * + * @param targetPath the targetPath value to set + * @return the SQLDataDirectoryMapping object itself. + */ + public SQLDataDirectoryMapping withTargetPath(String targetPath) { + this.targetPath = targetPath; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectoryType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectoryType.java new file mode 100644 index 0000000000000..327631ce24cd2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SQLDataDirectoryType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SQLDataDirectoryType. + */ +public final class SQLDataDirectoryType extends ExpandableStringEnum { + /** Static value Invalid for SQLDataDirectoryType. */ + public static final SQLDataDirectoryType INVALID = fromString("Invalid"); + + /** Static value Data for SQLDataDirectoryType. */ + public static final SQLDataDirectoryType DATA = fromString("Data"); + + /** Static value Log for SQLDataDirectoryType. */ + public static final SQLDataDirectoryType LOG = fromString("Log"); + + /** + * Creates or finds a SQLDataDirectoryType from its string representation. + * @param name a name to look for + * @return the corresponding SQLDataDirectoryType + */ + @JsonCreator + public static SQLDataDirectoryType fromString(String name) { + return fromString(name, SQLDataDirectoryType.class); + } + + /** + * @return known SQLDataDirectoryType values + */ + public static Collection values() { + return values(SQLDataDirectoryType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SchedulePolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SchedulePolicy.java new file mode 100644 index 0000000000000..5c2e5097f09e9 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SchedulePolicy.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for backup schedule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType", defaultImpl = SchedulePolicy.class) +@JsonTypeName("SchedulePolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "LogSchedulePolicy", value = LogSchedulePolicy.class), + @JsonSubTypes.Type(name = "LongTermSchedulePolicy", value = LongTermSchedulePolicy.class), + @JsonSubTypes.Type(name = "SimpleSchedulePolicy", value = SimpleSchedulePolicy.class) +}) +public class SchedulePolicy { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ScheduleRunType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ScheduleRunType.java new file mode 100644 index 0000000000000..aee0372645d06 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ScheduleRunType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ScheduleRunType. + */ +public final class ScheduleRunType extends ExpandableStringEnum { + /** Static value Invalid for ScheduleRunType. */ + public static final ScheduleRunType INVALID = fromString("Invalid"); + + /** Static value Daily for ScheduleRunType. */ + public static final ScheduleRunType DAILY = fromString("Daily"); + + /** Static value Weekly for ScheduleRunType. */ + public static final ScheduleRunType WEEKLY = fromString("Weekly"); + + /** + * Creates or finds a ScheduleRunType from its string representation. + * @param name a name to look for + * @return the corresponding ScheduleRunType + */ + @JsonCreator + public static ScheduleRunType fromString(String name) { + return fromString(name, ScheduleRunType.class); + } + + /** + * @return known ScheduleRunType values + */ + public static Collection values() { + return values(ScheduleRunType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SecurityPINs.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SecurityPINs.java new file mode 100644 index 0000000000000..5234e8c1cb83c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SecurityPINs.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.SecurityPINsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SecurityPINs. + */ +public interface SecurityPINs extends HasInner { + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Settings.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Settings.java new file mode 100644 index 0000000000000..6ab8b9d32e921 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Settings.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Common settings field for backup management. + */ +public class Settings { + /** + * TimeZone optional input as string. For example: TimeZone = "Pacific + * Standard Time". + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * SQL compression flag. + */ + @JsonProperty(value = "issqlcompression") + private Boolean issqlcompression; + + /** + * Workload compression flag. This has been added so that + * 'isSqlCompression' + * will be deprecated once clients upgrade to consider this flag. + */ + @JsonProperty(value = "isCompression") + private Boolean isCompression; + + /** + * Get timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @return the timeZone value + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set timeZone optional input as string. For example: TimeZone = "Pacific Standard Time". + * + * @param timeZone the timeZone value to set + * @return the Settings object itself. + */ + public Settings withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get sQL compression flag. + * + * @return the issqlcompression value + */ + public Boolean issqlcompression() { + return this.issqlcompression; + } + + /** + * Set sQL compression flag. + * + * @param issqlcompression the issqlcompression value to set + * @return the Settings object itself. + */ + public Settings withIssqlcompression(Boolean issqlcompression) { + this.issqlcompression = issqlcompression; + return this; + } + + /** + * Get workload compression flag. This has been added so that 'isSqlCompression' + will be deprecated once clients upgrade to consider this flag. + * + * @return the isCompression value + */ + public Boolean isCompression() { + return this.isCompression; + } + + /** + * Set workload compression flag. This has been added so that 'isSqlCompression' + will be deprecated once clients upgrade to consider this flag. + * + * @param isCompression the isCompression value to set + * @return the Settings object itself. + */ + public Settings withIsCompression(Boolean isCompression) { + this.isCompression = isCompression; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SimpleRetentionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SimpleRetentionPolicy.java new file mode 100644 index 0000000000000..d4c958fe18b20 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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", defaultImpl = SimpleRetentionPolicy.class) +@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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SimpleSchedulePolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SimpleSchedulePolicy.java new file mode 100644 index 0000000000000..0ac79059e2f2b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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", defaultImpl = SimpleSchedulePolicy.class) +@JsonTypeName("SimpleSchedulePolicy") +public class SimpleSchedulePolicy extends SchedulePolicy { + /** + * Frequency of the schedule operation of this policy. Possible values + * include: 'Invalid', 'Daily', 'Weekly'. + */ + @JsonProperty(value = "scheduleRunFrequency") + private ScheduleRunType scheduleRunFrequency; + + /** + * List of days of week this schedule has to be run. + */ + @JsonProperty(value = "scheduleRunDays") + private List scheduleRunDays; + + /** + * List of times of day this schedule has to be run. + */ + @JsonProperty(value = "scheduleRunTimes") + private List scheduleRunTimes; + + /** + * At every number weeks this schedule has to be run. + */ + @JsonProperty(value = "scheduleWeeklyFrequency") + private Integer scheduleWeeklyFrequency; + + /** + * Get frequency of the schedule operation of this policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @return the scheduleRunFrequency value + */ + public ScheduleRunType scheduleRunFrequency() { + return this.scheduleRunFrequency; + } + + /** + * Set frequency of the schedule operation of this 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 list of days of week this schedule has to be run. + * + * @return the scheduleRunDays value + */ + public List scheduleRunDays() { + return this.scheduleRunDays; + } + + /** + * Set list of days of week this schedule has to be run. + * + * @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 of day this schedule has to be run. + * + * @return the scheduleRunTimes value + */ + public List scheduleRunTimes() { + return this.scheduleRunTimes; + } + + /** + * Set list of times of day this schedule has to be run. + * + * @param scheduleRunTimes the scheduleRunTimes value to set + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleRunTimes(List scheduleRunTimes) { + this.scheduleRunTimes = scheduleRunTimes; + return this; + } + + /** + * Get at every number weeks this schedule has to be run. + * + * @return the scheduleWeeklyFrequency value + */ + public Integer scheduleWeeklyFrequency() { + return this.scheduleWeeklyFrequency; + } + + /** + * Set at every number weeks this schedule has to be run. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SoftDeleteFeatureState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SoftDeleteFeatureState.java new file mode 100644 index 0000000000000..7d0d5fea79322 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SoftDeleteFeatureState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SoftDeleteFeatureState. + */ +public final class SoftDeleteFeatureState extends ExpandableStringEnum { + /** Static value Invalid for SoftDeleteFeatureState. */ + public static final SoftDeleteFeatureState INVALID = fromString("Invalid"); + + /** Static value Enabled for SoftDeleteFeatureState. */ + public static final SoftDeleteFeatureState ENABLED = fromString("Enabled"); + + /** Static value Disabled for SoftDeleteFeatureState. */ + public static final SoftDeleteFeatureState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SoftDeleteFeatureState from its string representation. + * @param name a name to look for + * @return the corresponding SoftDeleteFeatureState + */ + @JsonCreator + public static SoftDeleteFeatureState fromString(String name) { + return fromString(name, SoftDeleteFeatureState.class); + } + + /** + * @return known SoftDeleteFeatureState values + */ + public static Collection values() { + return values(SoftDeleteFeatureState.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/StorageType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/StorageType.java new file mode 100644 index 0000000000000..535ede88fc0fd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/StorageType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StorageType. + */ +public final class StorageType extends ExpandableStringEnum { + /** Static value Invalid for StorageType. */ + public static final StorageType INVALID = fromString("Invalid"); + + /** Static value GeoRedundant for StorageType. */ + public static final StorageType GEO_REDUNDANT = fromString("GeoRedundant"); + + /** Static value LocallyRedundant for StorageType. */ + public static final StorageType LOCALLY_REDUNDANT = fromString("LocallyRedundant"); + + /** Static value ZoneRedundant for StorageType. */ + public static final StorageType ZONE_REDUNDANT = fromString("ZoneRedundant"); + + /** Static value ReadAccessGeoZoneRedundant for StorageType. */ + public static final StorageType READ_ACCESS_GEO_ZONE_REDUNDANT = fromString("ReadAccessGeoZoneRedundant"); + + /** + * Creates or finds a StorageType from its string representation. + * @param name a name to look for + * @return the corresponding StorageType + */ + @JsonCreator + public static StorageType fromString(String name) { + return fromString(name, StorageType.class); + } + + /** + * @return known StorageType values + */ + public static Collection values() { + return values(StorageType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/StorageTypeState.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/StorageTypeState.java new file mode 100644 index 0000000000000..db052eb3dac34 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/StorageTypeState.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StorageTypeState. + */ +public final class StorageTypeState extends ExpandableStringEnum { + /** Static value Invalid for StorageTypeState. */ + public static final StorageTypeState INVALID = fromString("Invalid"); + + /** Static value Locked for StorageTypeState. */ + public static final StorageTypeState LOCKED = fromString("Locked"); + + /** Static value Unlocked for StorageTypeState. */ + public static final StorageTypeState UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a StorageTypeState from its string representation. + * @param name a name to look for + * @return the corresponding StorageTypeState + */ + @JsonCreator + public static StorageTypeState fromString(String name) { + return fromString(name, StorageTypeState.class); + } + + /** + * @return known StorageTypeState values + */ + public static Collection values() { + return values(StorageTypeState.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SubProtectionPolicy.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SubProtectionPolicy.java new file mode 100644 index 0000000000000..4aa4e53d6a6bb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SubProtectionPolicy.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Sub-protection policy which includes schedule and retention. + */ +public class SubProtectionPolicy { + /** + * Type of backup policy type. Possible values include: 'Invalid', 'Full', + * 'Differential', 'Log', 'CopyOnlyFull', 'Incremental'. + */ + @JsonProperty(value = "policyType") + private PolicyType policyType; + + /** + * Backup schedule specified as part of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /** + * Retention policy with the details on backup copy retention ranges. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get type of backup policy type. Possible values include: 'Invalid', 'Full', 'Differential', 'Log', 'CopyOnlyFull', 'Incremental'. + * + * @return the policyType value + */ + public PolicyType policyType() { + return this.policyType; + } + + /** + * Set type of backup policy type. Possible values include: 'Invalid', 'Full', 'Differential', 'Log', 'CopyOnlyFull', 'Incremental'. + * + * @param policyType the policyType value to set + * @return the SubProtectionPolicy object itself. + */ + public SubProtectionPolicy withPolicyType(PolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get backup schedule specified as part of backup policy. + * + * @return the schedulePolicy value + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set backup schedule specified as part of backup policy. + * + * @param schedulePolicy the schedulePolicy value to set + * @return the SubProtectionPolicy object itself. + */ + public SubProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get retention policy with the details on backup copy retention ranges. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set retention policy with the details on backup copy retention ranges. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the SubProtectionPolicy object itself. + */ + public SubProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SupportStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SupportStatus.java new file mode 100644 index 0000000000000..d4a45e5e9a6a2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/SupportStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SupportStatus. + */ +public final class SupportStatus extends ExpandableStringEnum { + /** Static value Invalid for SupportStatus. */ + public static final SupportStatus INVALID = fromString("Invalid"); + + /** Static value Supported for SupportStatus. */ + public static final SupportStatus SUPPORTED = fromString("Supported"); + + /** Static value DefaultOFF for SupportStatus. */ + public static final SupportStatus DEFAULT_OFF = fromString("DefaultOFF"); + + /** Static value DefaultON for SupportStatus. */ + public static final SupportStatus DEFAULT_ON = fromString("DefaultON"); + + /** Static value NotSupported for SupportStatus. */ + public static final SupportStatus NOT_SUPPORTED = fromString("NotSupported"); + + /** + * Creates or finds a SupportStatus from its string representation. + * @param name a name to look for + * @return the corresponding SupportStatus + */ + @JsonCreator + public static SupportStatus fromString(String name) { + return fromString(name, SupportStatus.class); + } + + /** + * @return known SupportStatus values + */ + public static Collection values() { + return values(SupportStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TargetAFSRestoreInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TargetAFSRestoreInfo.java new file mode 100644 index 0000000000000..62e31de85acaa --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TargetAFSRestoreInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Target Azure File Share Info. + */ +public class TargetAFSRestoreInfo { + /** + * File share name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Target file share resource ARM ID. + */ + @JsonProperty(value = "targetResourceId") + private String targetResourceId; + + /** + * Get file share name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set file share name. + * + * @param name the name value to set + * @return the TargetAFSRestoreInfo object itself. + */ + public TargetAFSRestoreInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get target file share resource ARM ID. + * + * @return the targetResourceId value + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set target file share resource ARM ID. + * + * @param targetResourceId the targetResourceId value to set + * @return the TargetAFSRestoreInfo object itself. + */ + public TargetAFSRestoreInfo withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TargetRestoreInfo.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TargetRestoreInfo.java new file mode 100644 index 0000000000000..c1eb2f7abc026 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TargetRestoreInfo.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about target workload during restore operation. + */ +public class TargetRestoreInfo { + /** + * Can Overwrite if Target DataBase already exists. Possible values + * include: 'Invalid', 'FailOnConflict', 'Overwrite'. + */ + @JsonProperty(value = "overwriteOption") + private OverwriteOptions overwriteOption; + + /** + * Resource Id name of the container in which Target DataBase resides. + */ + @JsonProperty(value = "containerId") + private String containerId; + + /** + * Database name InstanceName/DataBaseName for SQL or System/DbName for SAP + * Hana. + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Target directory location for restore as files. + */ + @JsonProperty(value = "targetDirectoryForFileRestore") + private String targetDirectoryForFileRestore; + + /** + * Get can Overwrite if Target DataBase already exists. Possible values include: 'Invalid', 'FailOnConflict', 'Overwrite'. + * + * @return the overwriteOption value + */ + public OverwriteOptions overwriteOption() { + return this.overwriteOption; + } + + /** + * Set can Overwrite if Target DataBase already exists. Possible values include: 'Invalid', 'FailOnConflict', 'Overwrite'. + * + * @param overwriteOption the overwriteOption value to set + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withOverwriteOption(OverwriteOptions overwriteOption) { + this.overwriteOption = overwriteOption; + return this; + } + + /** + * Get resource Id name of the container in which Target DataBase resides. + * + * @return the containerId value + */ + public String containerId() { + return this.containerId; + } + + /** + * Set resource Id name of the container in which Target DataBase resides. + * + * @param containerId the containerId value to set + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. + * + * @param databaseName the databaseName value to set + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get target directory location for restore as files. + * + * @return the targetDirectoryForFileRestore value + */ + public String targetDirectoryForFileRestore() { + return this.targetDirectoryForFileRestore; + } + + /** + * Set target directory location for restore as files. + * + * @param targetDirectoryForFileRestore the targetDirectoryForFileRestore value to set + * @return the TargetRestoreInfo object itself. + */ + public TargetRestoreInfo withTargetDirectoryForFileRestore(String targetDirectoryForFileRestore) { + this.targetDirectoryForFileRestore = targetDirectoryForFileRestore; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TokenInformation.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TokenInformation.java new file mode 100644 index 0000000000000..76d1a683cddbc --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/TokenInformation.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.TokenInformationInner; + +/** + * Type representing TokenInformation. + */ +public interface TokenInformation extends HasInner, HasManager { + /** + * @return the expiryTimeInUtcTicks value. + */ + Long expiryTimeInUtcTicks(); + + /** + * @return the securityPIN value. + */ + String securityPIN(); + + /** + * @return the token value. + */ + String token(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Type.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Type.java new file mode 100644 index 0000000000000..a926f9d85c49b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/Type.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Type. + */ +public final class Type extends ExpandableStringEnum { + /** Static value Invalid for Type. */ + public static final Type INVALID = fromString("Invalid"); + + /** Static value BackupProtectedItemCountSummary for Type. */ + public static final Type BACKUP_PROTECTED_ITEM_COUNT_SUMMARY = fromString("BackupProtectedItemCountSummary"); + + /** Static value BackupProtectionContainerCountSummary for Type. */ + public static final Type BACKUP_PROTECTION_CONTAINER_COUNT_SUMMARY = fromString("BackupProtectionContainerCountSummary"); + + /** + * Creates or finds a Type from its string representation. + * @param name a name to look for + * @return the corresponding Type + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * @return known Type values + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/UsagesUnit.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/UsagesUnit.java new file mode 100644 index 0000000000000..8f4c9a99b9bbd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/UsagesUnit.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UsagesUnit. + */ +public final class UsagesUnit extends ExpandableStringEnum { + /** Static value Count for UsagesUnit. */ + public static final UsagesUnit COUNT = fromString("Count"); + + /** Static value Bytes for UsagesUnit. */ + public static final UsagesUnit BYTES = fromString("Bytes"); + + /** Static value Seconds for UsagesUnit. */ + public static final UsagesUnit SECONDS = fromString("Seconds"); + + /** Static value Percent for UsagesUnit. */ + public static final UsagesUnit PERCENT = fromString("Percent"); + + /** Static value CountPerSecond for UsagesUnit. */ + public static final UsagesUnit COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** Static value BytesPerSecond for UsagesUnit. */ + public static final UsagesUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** + * Creates or finds a UsagesUnit from its string representation. + * @param name a name to look for + * @return the corresponding UsagesUnit + */ + @JsonCreator + public static UsagesUnit fromString(String name) { + return fromString(name, UsagesUnit.class); + } + + /** + * @return known UsagesUnit values + */ + public static Collection values() { + return values(UsagesUnit.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateIaasVMRestoreOperationRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateIaasVMRestoreOperationRequest.java new file mode 100644 index 0000000000000..1f3894ab97657 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateIaasVMRestoreOperationRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AzureRestoreValidation request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = ValidateIaasVMRestoreOperationRequest.class) +@JsonTypeName("ValidateIaasVMRestoreOperationRequest") +public class ValidateIaasVMRestoreOperationRequest extends ValidateRestoreOperationRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationRequest.java new file mode 100644 index 0000000000000..09c728ca3ca74 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationRequest.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for validate operation request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = ValidateOperationRequest.class) +@JsonTypeName("ValidateOperationRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ValidateRestoreOperationRequest", value = ValidateRestoreOperationRequest.class) +}) +public class ValidateOperationRequest { +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationResponse.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationResponse.java new file mode 100644 index 0000000000000..072886418c452 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationResponse.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for validate operation response. + */ +public class ValidateOperationResponse { + /** + * Gets the validation result. + */ + @JsonProperty(value = "validationResults") + private List validationResults; + + /** + * Get gets the validation result. + * + * @return the validationResults value + */ + public List validationResults() { + return this.validationResults; + } + + /** + * Set gets the validation result. + * + * @param validationResults the validationResults value to set + * @return the ValidateOperationResponse object itself. + */ + public ValidateOperationResponse withValidationResults(List validationResults) { + this.validationResults = validationResults; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationsResponse.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationsResponse.java new file mode 100644 index 0000000000000..f1a6a152f250c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateOperationsResponse.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ValidateOperationsResponseInner; + +/** + * Type representing ValidateOperationsResponse. + */ +public interface ValidateOperationsResponse extends HasInner, HasManager { + /** + * @return the validateOperationResponse value. + */ + ValidateOperationResponse validateOperationResponse(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateRestoreOperationRequest.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateRestoreOperationRequest.java new file mode 100644 index 0000000000000..e35b4664d074c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidateRestoreOperationRequest.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * AzureRestoreValidation request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", defaultImpl = ValidateRestoreOperationRequest.class) +@JsonTypeName("ValidateRestoreOperationRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ValidateIaasVMRestoreOperationRequest", value = ValidateIaasVMRestoreOperationRequest.class) +}) +public class ValidateRestoreOperationRequest extends ValidateOperationRequest { + /** + * Sets restore request to be validated. + */ + @JsonProperty(value = "restoreRequest") + private RestoreRequest restoreRequest; + + /** + * Get sets restore request to be validated. + * + * @return the restoreRequest value + */ + public RestoreRequest restoreRequest() { + return this.restoreRequest; + } + + /** + * Set sets restore request to be validated. + * + * @param restoreRequest the restoreRequest value to set + * @return the ValidateRestoreOperationRequest object itself. + */ + public ValidateRestoreOperationRequest withRestoreRequest(RestoreRequest restoreRequest) { + this.restoreRequest = restoreRequest; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidationStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidationStatus.java new file mode 100644 index 0000000000000..c287e9167d8e8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/ValidationStatus.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ValidationStatus. + */ +public final class ValidationStatus extends ExpandableStringEnum { + /** Static value Invalid for ValidationStatus. */ + public static final ValidationStatus INVALID = fromString("Invalid"); + + /** Static value Succeeded for ValidationStatus. */ + public static final ValidationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ValidationStatus. */ + public static final ValidationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ValidationStatus from its string representation. + * @param name a name to look for + * @return the corresponding ValidationStatus + */ + @JsonCreator + public static ValidationStatus fromString(String name) { + return fromString(name, ValidationStatus.class); + } + + /** + * @return known ValidationStatus values + */ + public static Collection values() { + return values(ValidationStatus.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultJobResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultJobResource.java new file mode 100644 index 0000000000000..7465d5fa2156d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.JobResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultJobResourceModel.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultJobResourceModel.java new file mode 100644 index 0000000000000..f24df19252c03 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultOperationStatus.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultOperationStatus.java new file mode 100644 index 0000000000000..aefa0c0b62636 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultProtectionContainerResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultProtectionContainerResource.java new file mode 100644 index 0000000000000..e22325612ae7b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/VaultProtectionContainerResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.ProtectionContainerResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing VaultProtectionContainerResource. + */ +public interface VaultProtectionContainerResource 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WeekOfMonth.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WeekOfMonth.java new file mode 100644 index 0000000000000..4a64ce9de3aa8 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WeekOfMonth.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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"), + + /** Enum value Invalid. */ + INVALID("Invalid"); + + /** 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WeeklyRetentionFormat.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WeeklyRetentionFormat.java new file mode 100644 index 0000000000000..831415043c718 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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 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 month. + * + * @return the weeksOfTheMonth value + */ + public List weeksOfTheMonth() { + return this.weeksOfTheMonth; + } + + /** + * Set list of weeks of 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WeeklyRetentionSchedule.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WeeklyRetentionSchedule.java new file mode 100644 index 0000000000000..dc8fa91e28782 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Weekly retention schedule. + */ +public class WeeklyRetentionSchedule { + /** + * List of days of week for weekly retention policy. + */ + @JsonProperty(value = "daysOfTheWeek") + private List daysOfTheWeek; + + /** + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * Retention duration of retention Policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get list of days of week for weekly retention policy. + * + * @return the daysOfTheWeek value + */ + public List daysOfTheWeek() { + return this.daysOfTheWeek; + } + + /** + * Set list of days of week for 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 retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set retention times of 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadInquiryDetails.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadInquiryDetails.java new file mode 100644 index 0000000000000..d2a9c473c4561 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadInquiryDetails.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of an inquired protectable item. + */ +public class WorkloadInquiryDetails { + /** + * Type of the Workload such as SQL, Oracle etc. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Contains the protectable item Count inside this Container. + */ + @JsonProperty(value = "itemCount") + private Long itemCount; + + /** + * Inquiry validation such as permissions and other backup validations. + */ + @JsonProperty(value = "inquiryValidation") + private InquiryValidation inquiryValidation; + + /** + * Get type of the Workload such as SQL, Oracle etc. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the Workload such as SQL, Oracle etc. + * + * @param type the type value to set + * @return the WorkloadInquiryDetails object itself. + */ + public WorkloadInquiryDetails withType(String type) { + this.type = type; + return this; + } + + /** + * Get contains the protectable item Count inside this Container. + * + * @return the itemCount value + */ + public Long itemCount() { + return this.itemCount; + } + + /** + * Set contains the protectable item Count inside this Container. + * + * @param itemCount the itemCount value to set + * @return the WorkloadInquiryDetails object itself. + */ + public WorkloadInquiryDetails withItemCount(Long itemCount) { + this.itemCount = itemCount; + return this; + } + + /** + * Get inquiry validation such as permissions and other backup validations. + * + * @return the inquiryValidation value + */ + public InquiryValidation inquiryValidation() { + return this.inquiryValidation; + } + + /** + * Set inquiry validation such as permissions and other backup validations. + * + * @param inquiryValidation the inquiryValidation value to set + * @return the WorkloadInquiryDetails object itself. + */ + public WorkloadInquiryDetails withInquiryValidation(InquiryValidation inquiryValidation) { + this.inquiryValidation = inquiryValidation; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItem.java new file mode 100644 index 0000000000000..abbfba48d2e4c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItem.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for backup item. Workload-specific backup items are derived from + * this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "workloadItemType", defaultImpl = WorkloadItem.class) +@JsonTypeName("WorkloadItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureVmWorkloadItem", value = AzureVmWorkloadItem.class) +}) +public class WorkloadItem { + /** + * Type of backup management to backup an item. + */ + @JsonProperty(value = "backupManagementType") + private String backupManagementType; + + /** + * Type of workload for the backup management. + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /** + * Friendly name of the backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * State of the back up item. Possible values include: 'Invalid', + * 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + */ + @JsonProperty(value = "protectionState") + private ProtectionStatus protectionState; + + /** + * Get type of backup management to backup an item. + * + * @return the backupManagementType value + */ + public String backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management to backup an item. + * + * @param backupManagementType the backupManagementType value to set + * @return the WorkloadItem object itself. + */ + public WorkloadItem withBackupManagementType(String backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get type of workload for the backup management. + * + * @return the workloadType value + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set type of workload for the backup management. + * + * @param workloadType the workloadType value to set + * @return the WorkloadItem object itself. + */ + public WorkloadItem withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get friendly name of the backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the backup item. + * + * @param friendlyName the friendlyName value to set + * @return the WorkloadItem object itself. + */ + public WorkloadItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get state of the back up item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @return the protectionState value + */ + public ProtectionStatus protectionState() { + return this.protectionState; + } + + /** + * Set state of the back up item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @param protectionState the protectionState value to set + * @return the WorkloadItem object itself. + */ + public WorkloadItem withProtectionState(ProtectionStatus protectionState) { + this.protectionState = protectionState; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItemResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItemResource.java new file mode 100644 index 0000000000000..dba80bdf5c654 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItemResource.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.WorkloadItemResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing WorkloadItemResource. + */ +public interface WorkloadItemResource 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. + */ + WorkloadItem properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItemType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItemType.java new file mode 100644 index 0000000000000..901d631c16a17 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadItemType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WorkloadItemType. + */ +public final class WorkloadItemType extends ExpandableStringEnum { + /** Static value Invalid for WorkloadItemType. */ + public static final WorkloadItemType INVALID = fromString("Invalid"); + + /** Static value SQLInstance for WorkloadItemType. */ + public static final WorkloadItemType SQLINSTANCE = fromString("SQLInstance"); + + /** Static value SQLDataBase for WorkloadItemType. */ + public static final WorkloadItemType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value SAPHanaSystem for WorkloadItemType. */ + public static final WorkloadItemType SAPHANA_SYSTEM = fromString("SAPHanaSystem"); + + /** Static value SAPHanaDatabase for WorkloadItemType. */ + public static final WorkloadItemType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseSystem for WorkloadItemType. */ + public static final WorkloadItemType SAPASE_SYSTEM = fromString("SAPAseSystem"); + + /** Static value SAPAseDatabase for WorkloadItemType. */ + public static final WorkloadItemType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a WorkloadItemType from its string representation. + * @param name a name to look for + * @return the corresponding WorkloadItemType + */ + @JsonCreator + public static WorkloadItemType fromString(String name) { + return fromString(name, WorkloadItemType.class); + } + + /** + * @return known WorkloadItemType values + */ + public static Collection values() { + return values(WorkloadItemType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadProtectableItem.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadProtectableItem.java new file mode 100644 index 0000000000000..39466020cc192 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadProtectableItem.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * 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", defaultImpl = WorkloadProtectableItem.class) +@JsonTypeName("WorkloadProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureFileShare", value = AzureFileShareProtectableItem.class), + @JsonSubTypes.Type(name = "AzureVmWorkloadProtectableItem", value = AzureVmWorkloadProtectableItem.class), + @JsonSubTypes.Type(name = "IaaSVMProtectableItem", value = IaaSVMProtectableItem.class) +}) +public class WorkloadProtectableItem { + /** + * Type of backup management to backup an item. + */ + @JsonProperty(value = "backupManagementType") + private String backupManagementType; + + /** + * Type of workload for the backup management. + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /** + * Friendly name of the backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * State of the back up item. Possible values include: 'Invalid', + * 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + */ + @JsonProperty(value = "protectionState") + private ProtectionStatus protectionState; + + /** + * Get type of backup management to backup an item. + * + * @return the backupManagementType value + */ + public String backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management to backup an item. + * + * @param backupManagementType the backupManagementType value to set + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withBackupManagementType(String backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get type of workload for the backup management. + * + * @return the workloadType value + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set type of workload for the backup management. + * + * @param workloadType the workloadType value to set + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get friendly name of the backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set 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 state of the back up item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @return the protectionState value + */ + public ProtectionStatus protectionState() { + return this.protectionState; + } + + /** + * Set state of the back up item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadProtectableItemResource.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadProtectableItemResource.java new file mode 100644 index 0000000000000..82eb8dea0a8ff --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation.WorkloadProtectableItemResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadType.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadType.java new file mode 100644 index 0000000000000..fcaf380dffe4e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/WorkloadType.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WorkloadType. + */ +public final class WorkloadType extends ExpandableStringEnum { + /** Static value Invalid for WorkloadType. */ + public static final WorkloadType INVALID = fromString("Invalid"); + + /** Static value VM for WorkloadType. */ + public static final WorkloadType VM = fromString("VM"); + + /** Static value FileFolder for WorkloadType. */ + public static final WorkloadType FILE_FOLDER = fromString("FileFolder"); + + /** Static value AzureSqlDb for WorkloadType. */ + public static final WorkloadType AZURE_SQL_DB = fromString("AzureSqlDb"); + + /** Static value SQLDB for WorkloadType. */ + public static final WorkloadType SQLDB = fromString("SQLDB"); + + /** Static value Exchange for WorkloadType. */ + public static final WorkloadType EXCHANGE = fromString("Exchange"); + + /** Static value Sharepoint for WorkloadType. */ + public static final WorkloadType SHAREPOINT = fromString("Sharepoint"); + + /** Static value VMwareVM for WorkloadType. */ + public static final WorkloadType VMWARE_VM = fromString("VMwareVM"); + + /** Static value SystemState for WorkloadType. */ + public static final WorkloadType SYSTEM_STATE = fromString("SystemState"); + + /** Static value Client for WorkloadType. */ + public static final WorkloadType CLIENT = fromString("Client"); + + /** Static value GenericDataSource for WorkloadType. */ + public static final WorkloadType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** Static value SQLDataBase for WorkloadType. */ + public static final WorkloadType SQLDATA_BASE = fromString("SQLDataBase"); + + /** Static value AzureFileShare for WorkloadType. */ + public static final WorkloadType AZURE_FILE_SHARE = fromString("AzureFileShare"); + + /** Static value SAPHanaDatabase for WorkloadType. */ + public static final WorkloadType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); + + /** Static value SAPAseDatabase for WorkloadType. */ + public static final WorkloadType SAPASE_DATABASE = fromString("SAPAseDatabase"); + + /** + * Creates or finds a WorkloadType from its string representation. + * @param name a name to look for + * @return the corresponding WorkloadType + */ + @JsonCreator + public static WorkloadType fromString(String name) { + return fromString(name, WorkloadType.class); + } + + /** + * @return known WorkloadType values + */ + public static Collection values() { + return values(WorkloadType.class); + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/YearlyRetentionSchedule.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/YearlyRetentionSchedule.java new file mode 100644 index 0000000000000..a6dde7f43a4d3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02; + +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 yearly retention policy. Possible values + * include: 'Invalid', 'Daily', 'Weekly'. + */ + @JsonProperty(value = "retentionScheduleFormatType") + private RetentionScheduleFormat retentionScheduleFormatType; + + /** + * List of months of year of yearly retention policy. + */ + @JsonProperty(value = "monthsOfYear") + private List monthsOfYear; + + /** + * Daily retention format for yearly retention policy. + */ + @JsonProperty(value = "retentionScheduleDaily") + private DailyRetentionFormat retentionScheduleDaily; + + /** + * Weekly retention format for yearly retention policy. + */ + @JsonProperty(value = "retentionScheduleWeekly") + private WeeklyRetentionFormat retentionScheduleWeekly; + + /** + * Retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * Retention duration of retention Policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get retention schedule format for yearly retention policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @return the retentionScheduleFormatType value + */ + public RetentionScheduleFormat retentionScheduleFormatType() { + return this.retentionScheduleFormatType; + } + + /** + * Set retention schedule format for 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 months of year of yearly retention policy. + * + * @return the monthsOfYear value + */ + public List monthsOfYear() { + return this.monthsOfYear; + } + + /** + * Set list of months of year of 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 yearly retention policy. + * + * @return the retentionScheduleDaily value + */ + public DailyRetentionFormat retentionScheduleDaily() { + return this.retentionScheduleDaily; + } + + /** + * Set daily retention format for 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 yearly retention policy. + * + * @return the retentionScheduleWeekly value + */ + public WeeklyRetentionFormat retentionScheduleWeekly() { + return this.retentionScheduleWeekly; + } + + /** + * Set weekly retention format for 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 of retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set retention times of 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 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 YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/AzureVMResourceFeatureSupportResponseImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/AzureVMResourceFeatureSupportResponseImpl.java new file mode 100644 index 0000000000000..725e79175b566 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/AzureVMResourceFeatureSupportResponseImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.AzureVMResourceFeatureSupportResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.SupportStatus; + +class AzureVMResourceFeatureSupportResponseImpl extends WrapperImpl implements AzureVMResourceFeatureSupportResponse { + private final RecoveryServicesManager manager; + AzureVMResourceFeatureSupportResponseImpl(AzureVMResourceFeatureSupportResponseInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public SupportStatus supportStatus() { + return this.inner().supportStatus(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/AzureVMResourceFeatureSupportResponseInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/AzureVMResourceFeatureSupportResponseInner.java new file mode 100644 index 0000000000000..721260f982a35 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/AzureVMResourceFeatureSupportResponseInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.SupportStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for feature support requests for Azure IaasVm. + */ +public class AzureVMResourceFeatureSupportResponseInner { + /** + * Support status of feature. Possible values include: 'Invalid', + * 'Supported', 'DefaultOFF', 'DefaultON', 'NotSupported'. + */ + @JsonProperty(value = "supportStatus") + private SupportStatus supportStatus; + + /** + * Get support status of feature. Possible values include: 'Invalid', 'Supported', 'DefaultOFF', 'DefaultON', 'NotSupported'. + * + * @return the supportStatus value + */ + public SupportStatus supportStatus() { + return this.supportStatus; + } + + /** + * Set support status of feature. Possible values include: 'Invalid', 'Supported', 'DefaultOFF', 'DefaultON', 'NotSupported'. + * + * @param supportStatus the supportStatus value to set + * @return the AzureVMResourceFeatureSupportResponseInner object itself. + */ + public AzureVMResourceFeatureSupportResponseInner withSupportStatus(SupportStatus supportStatus) { + this.supportStatus = supportStatus; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEngineBaseResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEngineBaseResourceImpl.java new file mode 100644 index 0000000000000..18d27031c6397 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEngineBaseResourceImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupEngineBaseResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupEngineBase; +import java.util.Map; + +class BackupEngineBaseResourceImpl extends IndexableRefreshableWrapperImpl implements BackupEngineBaseResource { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String backupEngineName; + + BackupEngineBaseResourceImpl(BackupEngineBaseResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.backupEngineName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupEngines"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + BackupEnginesInner client = this.manager().inner().backupEngines(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.backupEngineName); + } + + + + @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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEngineBaseResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEngineBaseResourceInner.java new file mode 100644 index 0000000000000..8860a239b22de --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEngineBaseResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 { + /** + * BackupEngineBaseResource properties. + */ + @JsonProperty(value = "properties") + private BackupEngineBase properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get backupEngineBaseResource properties. + * + * @return the properties value + */ + public BackupEngineBase properties() { + return this.properties; + } + + /** + * Set backupEngineBaseResource properties. + * + * @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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEnginesImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEnginesImpl.java new file mode 100644 index 0000000000000..734d608c2ae65 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEnginesImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupEngines; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 listAsync(final String vaultName, final String resourceGroupName) { + BackupEnginesInner 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 BackupEngineBaseResource call(BackupEngineBaseResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String backupEngineName) { + BackupEnginesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, backupEngineName) + .flatMap(new Func1>() { + @Override + public Observable call(BackupEngineBaseResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BackupEngineBaseResource)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEnginesInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEnginesInner.java new file mode 100644 index 0000000000000..50a984e531a01 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupEnginesInner.java @@ -0,0 +1,619 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.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.v2020_02_02.BackupEngines list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines") + 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.v2020_02_02.BackupEngines get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("backupEngineName") String backupEngineName, @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.v2020_02_02.BackupEngines listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 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(); + } + }; + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> 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(); + } + }); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> 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)); + } + }); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackupEngineBaseResourceInner> 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."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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); + } + } + }); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 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(); + } + }; + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> 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(); + } + }); + } + + /** + * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> 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)); + } + }); + } + + /** + * Backup management servers registered to Recovery Services Vault. 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 where the recovery services vault is present. + ServiceResponse> * @param filter OData filter options. + ServiceResponse> * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackupEngineBaseResourceInner> 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."); + } + final String apiVersion = "2016-12-01"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @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 BackupEngineBaseResourceInner object if successful. + */ + public BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, backupEngineName).toBlocking().single().body(); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @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 backupEngineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, backupEngineName), serviceCallback); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupEngineBaseResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String backupEngineName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, backupEngineName).map(new Func1, BackupEngineBaseResourceInner>() { + @Override + public BackupEngineBaseResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupEngineBaseResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String backupEngineName) { + 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 (backupEngineName == null) { + throw new IllegalArgumentException("Parameter backupEngineName is required and cannot be null."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + final String skipToken = null; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), backupEngineName, apiVersion, filter, skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken 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 BackupEngineBaseResourceInner object if successful. + */ + public BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName, String filter, String skipToken) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken).toBlocking().single().body(); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken 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(String vaultName, String resourceGroupName, String backupEngineName, String filter, String skipToken, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken), serviceCallback); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupEngineBaseResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String backupEngineName, String filter, String skipToken) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken).map(new Func1, BackupEngineBaseResourceInner>() { + @Override + public BackupEngineBaseResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns backup management server registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param backupEngineName Name of the backup management server. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupEngineBaseResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String backupEngineName, String filter, 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 (backupEngineName == null) { + throw new IllegalArgumentException("Parameter backupEngineName is required and cannot be null."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), backupEngineName, apiVersion, filter, skipToken, 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); + } + + /** + * Backup management servers registered to Recovery Services Vault. 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 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(); + } + }; + } + + /** + * Backup management servers registered to Recovery Services Vault. 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> 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); + } + + /** + * Backup management servers registered to Recovery Services Vault. 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> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Backup management servers registered to Recovery Services Vault. 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>> 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)); + } + }); + } + + /** + * Backup management servers registered to Recovery Services Vault. 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>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupFabricVaultOperationStatusImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupFabricVaultOperationStatusImpl.java new file mode 100644 index 0000000000000..f8e6a06b5b0cc --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupFabricVaultOperationStatusImpl.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupFabricVaultOperationStatus; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusExtendedInfo; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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; + // set resource ancestor and positional variables + 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupFabricVaultProtectionContainerResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupFabricVaultProtectionContainerResourceImpl.java new file mode 100644 index 0000000000000..e5b09135622af --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupFabricVaultProtectionContainerResourceImpl.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupFabricVaultProtectionContainerResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; + +class BackupFabricVaultProtectionContainerResourceImpl extends CreatableUpdatableImpl implements BackupFabricVaultProtectionContainerResource, BackupFabricVaultProtectionContainerResource.Definition, BackupFabricVaultProtectionContainerResource.Update { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String fabricName; + private String containerName; + + BackupFabricVaultProtectionContainerResourceImpl(String name, RecoveryServicesManager manager) { + super(name, new ProtectionContainerResourceInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + } + + BackupFabricVaultProtectionContainerResourceImpl(ProtectionContainerResourceInner inner, RecoveryServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // set resource ancestor and positional variables + 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 + public Observable createResourceAsync() { + ProtectionContainersInner client = this.manager().inner().protectionContainers(); + return client.registerAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProtectionContainersInner client = this.manager().inner().protectionContainers(); + return client.registerAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProtectionContainersInner client = this.manager().inner().protectionContainers(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName); + } + + @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 ProtectionContainerInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BackupFabricVaultProtectionContainerResourceImpl withExistingBackupFabric(String vaultName, String resourceGroupName, String fabricName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + this.fabricName = fabricName; + return this; + } + + @Override + public BackupFabricVaultProtectionContainerResourceImpl withETag(String eTag) { + this.inner().withETag(eTag); + return this; + } + + @Override + public BackupFabricVaultProtectionContainerResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public BackupFabricVaultProtectionContainerResourceImpl withProperties(ProtectionContainerInner properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public BackupFabricVaultProtectionContainerResourceImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupJobsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupJobsImpl.java new file mode 100644 index 0000000000000..4f47a9a48a20b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupJobsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupJobs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.VaultJobResource; + +class BackupJobsImpl extends WrapperImpl implements BackupJobs { + private final RecoveryServicesManager manager; + + BackupJobsImpl(RecoveryServicesManager manager) { + super(manager.inner().backupJobs()); + 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) { + BackupJobsInner 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); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupJobsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupJobsInner.java new file mode 100644 index 0000000000000..c79fa63d7551b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupJobsInner.java @@ -0,0 +1,429 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 BackupJobs. + */ +public class BackupJobsInner { + /** The Retrofit service to perform REST calls. */ + private BackupJobsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupJobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupJobsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupJobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupJobs to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupJobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupJobs 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.v2020_02_02.BackupJobs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 where the recovery services vault is present. + * @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 where the recovery services vault is present. + * @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 where the recovery services vault is present. + * @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 where the recovery services vault is present. + * @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."); + } + final String apiVersion = "2019-06-15"; + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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 where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 where the recovery services vault is present. + ServiceResponse> * @param filter OData filter options. + ServiceResponse> * @param skipToken skipToken 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."); + } + final String apiVersion = "2019-06-15"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupManagementUsageImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupManagementUsageImpl.java new file mode 100644 index 0000000000000..3a948dc8323bd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupManagementUsageImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupManagementUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.NameInfo; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.UsagesUnit; + +class BackupManagementUsageImpl extends WrapperImpl implements BackupManagementUsage { + private final RecoveryServicesManager manager; + + BackupManagementUsageImpl(BackupManagementUsageInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + + + @Override + public Long currentValue() { + return this.inner().currentValue(); + } + + @Override + public Long limit() { + return this.inner().limit(); + } + + @Override + public NameInfo name() { + return this.inner().name(); + } + + @Override + public DateTime nextResetTime() { + return this.inner().nextResetTime(); + } + + @Override + public String quotaPeriod() { + return this.inner().quotaPeriod(); + } + + @Override + public UsagesUnit unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupManagementUsageInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupManagementUsageInner.java new file mode 100644 index 0000000000000..b5439c7931459 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupManagementUsageInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.UsagesUnit; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.NameInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Backup management usages of a vault. + */ +public class BackupManagementUsageInner { + /** + * Unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', + * 'Percent', 'CountPerSecond', 'BytesPerSecond'. + */ + @JsonProperty(value = "unit") + private UsagesUnit unit; + + /** + * Quota period of usage. + */ + @JsonProperty(value = "quotaPeriod") + private String quotaPeriod; + + /** + * Next reset time of usage. + */ + @JsonProperty(value = "nextResetTime") + private DateTime nextResetTime; + + /** + * Current value of usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * Limit of usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /** + * Name of usage. + */ + @JsonProperty(value = "name") + private NameInfo name; + + /** + * Get unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond'. + * + * @return the unit value + */ + public UsagesUnit unit() { + return this.unit; + } + + /** + * Set unit of the usage. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond'. + * + * @param unit the unit value to set + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withUnit(UsagesUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get quota period of usage. + * + * @return the quotaPeriod value + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Set quota period of usage. + * + * @param quotaPeriod the quotaPeriod value to set + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withQuotaPeriod(String quotaPeriod) { + this.quotaPeriod = quotaPeriod; + return this; + } + + /** + * Get next reset time of usage. + * + * @return the nextResetTime value + */ + public DateTime nextResetTime() { + return this.nextResetTime; + } + + /** + * Set next reset time of usage. + * + * @param nextResetTime the nextResetTime value to set + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withNextResetTime(DateTime nextResetTime) { + this.nextResetTime = nextResetTime; + return this; + } + + /** + * Get current value of usage. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set current value of usage. + * + * @param currentValue the currentValue value to set + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get limit of usage. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Set limit of usage. + * + * @param limit the limit value to set + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get name of usage. + * + * @return the name value + */ + public NameInfo name() { + return this.name; + } + + /** + * Set name of usage. + * + * @param name the name value to set + * @return the BackupManagementUsageInner object itself. + */ + public BackupManagementUsageInner withName(NameInfo name) { + this.name = name; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationResultsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationResultsImpl.java new file mode 100644 index 0000000000000..5994cfcfb4abb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationResultsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationResultsInner.java new file mode 100644 index 0000000000000..03f3c385afc2e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationResultsInner.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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 such as deleting backed up item. Once the operation has started, the + status code in the response would be Accepted. It will continue to be in this state till it reaches completion. On + successful completion, the status code will be 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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 such as deleting backed up item. Once the operation has started, the + status code in the response would be Accepted. It will continue to be in this state till it reaches completion. On + successful completion, the status code will be 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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 such as deleting backed up item. Once the operation has started, the + status code in the response would be Accepted. It will continue to be in this state till it reaches completion. On + successful completion, the status code will be 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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 such as deleting backed up item. Once the operation has started, the + status code in the response would be Accepted. It will continue to be in this state till it reaches completion. On + successful completion, the status code will be 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationStatusesImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationStatusesImpl.java new file mode 100644 index 0000000000000..aa6f5dc98c708 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationStatusesImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupOperationStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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) + .flatMap(new Func1>() { + @Override + public Observable call(OperationStatusInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VaultOperationStatus)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationStatusesInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationStatusesInner.java new file mode 100644 index 0000000000000..4b54f4019fea7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupOperationStatusesInner.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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); + + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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(); + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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); + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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(); + } + }); + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param operationId OperationID which represents 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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupPolicyVaultOperationStatusImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupPolicyVaultOperationStatusImpl.java new file mode 100644 index 0000000000000..3a5813c8c9777 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupPolicyVaultOperationStatusImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupPolicyVaultOperationStatus; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusExtendedInfo; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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; + // set resource ancestor and positional variables + 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectableItemsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectableItemsImpl.java new file mode 100644 index 0000000000000..a00c9f82506ab --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectableItemsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectableItems; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.WorkloadProtectableItemResource; + +class BackupProtectableItemsImpl extends WrapperImpl implements BackupProtectableItems { + private final RecoveryServicesManager manager; + + BackupProtectableItemsImpl(RecoveryServicesManager manager) { + super(manager.inner().backupProtectableItems()); + 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) { + BackupProtectableItemsInner 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectableItemsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectableItemsInner.java new file mode 100644 index 0000000000000..58550f4f3452f --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectableItemsInner.java @@ -0,0 +1,444 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 BackupProtectableItems. + */ +public class BackupProtectableItemsInner { + /** The Retrofit service to perform REST calls. */ + private BackupProtectableItemsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectableItemsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupProtectableItemsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupProtectableItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupProtectableItems to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupProtectableItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectableItems 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.v2020_02_02.BackupProtectableItems listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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(); + } + }; + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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(); + } + }); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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)); + } + }); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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 protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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(); + } + }; + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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(); + } + }); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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)); + } + }); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + ServiceResponse> * @param vaultName The name of the recovery services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group where the recovery services vault is present. + ServiceResponse> * @param filter OData filter options. + ServiceResponse> * @param skipToken skipToken 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."); + } + final String apiVersion = "2016-12-01"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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 protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @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(); + } + }; + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @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 protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @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(); + } + }); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + * @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)); + } + }); + } + + /** + * Provides a pageable list of protectable objects within your subscription according to the query filter and the + pagination parameters. + * + 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectedItemsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectedItemsImpl.java new file mode 100644 index 0000000000000..297e1a14b38fa --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectedItemsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectedItems; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectedItemResource; + +class BackupProtectedItemsImpl extends WrapperImpl implements BackupProtectedItems { + private final RecoveryServicesManager manager; + + BackupProtectedItemsImpl(RecoveryServicesManager manager) { + super(manager.inner().backupProtectedItems()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private ProtectedItemResourceImpl wrapModel(ProtectedItemResourceInner inner) { + return new ProtectedItemResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName) { + BackupProtectedItemsInner 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 ProtectedItemResource call(ProtectedItemResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectedItemsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectedItemsInner.java new file mode 100644 index 0000000000000..2adc65bf421b5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectedItemsInner.java @@ -0,0 +1,429 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 BackupProtectedItems. + */ +public class BackupProtectedItemsInner { + /** The Retrofit service to perform REST calls. */ + private BackupProtectedItemsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectedItemsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupProtectedItemsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupProtectedItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupProtectedItems to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupProtectedItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectedItems 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.v2020_02_02.BackupProtectedItems listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a pageable list of all items that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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."); + } + final String apiVersion = "2019-06-15"; + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 that are backed up within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 that are backed up within a vault. + * + ServiceResponse> * @param vaultName The name of the recovery services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group where the recovery services vault is present. + ServiceResponse> * @param filter OData filter options. + ServiceResponse> * @param skipToken skipToken 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."); + } + final String apiVersion = "2019-06-15"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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 all items that are backed up within a vault. + * + * @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 that are backed up within a vault. + * + * @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 that are backed up within a vault. + * + * @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 that are backed up within a vault. + * + * @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 that are backed up within a vault. + * + 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionContainersImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionContainersImpl.java new file mode 100644 index 0000000000000..dc7996486ea75 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionContainersImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectionContainers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.VaultProtectionContainerResource; + +class BackupProtectionContainersImpl extends WrapperImpl implements BackupProtectionContainers { + private final RecoveryServicesManager manager; + + BackupProtectionContainersImpl(RecoveryServicesManager manager) { + super(manager.inner().backupProtectionContainers()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private VaultProtectionContainerResourceImpl wrapModel(ProtectionContainerResourceInner inner) { + return new VaultProtectionContainerResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName) { + BackupProtectionContainersInner 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 VaultProtectionContainerResource call(ProtectionContainerResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionContainersInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionContainersInner.java new file mode 100644 index 0000000000000..29fcc3663c4d0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionContainersInner.java @@ -0,0 +1,423 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 BackupProtectionContainers. + */ +public class BackupProtectionContainersInner { + /** The Retrofit service to perform REST calls. */ + private BackupProtectionContainersService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectionContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupProtectionContainersInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupProtectionContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupProtectionContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupProtectionContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectionContainers 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.v2020_02_02.BackupProtectionContainers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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<ProtectionContainerResourceInner> 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(); + } + }; + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionContainerResourceInner> 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(); + } + }); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionContainerResourceInner> 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)); + } + }); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectionContainerResourceInner> 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."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @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<ProtectionContainerResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName, final String filter) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionContainerResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionContainerResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String filter) { + return listSinglePageAsync(vaultName, resourceGroupName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + ServiceResponse> * @param vaultName The name of the recovery services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group where the recovery services vault is present. + ServiceResponse> * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectionContainerResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final 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."); + } + final String apiVersion = "2016-12-01"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @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<ProtectionContainerResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @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<ProtectionContainerResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + * @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<ProtectionContainerResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the containers registered to Recovery Services Vault. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectionContainerResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionIntentsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionIntentsImpl.java new file mode 100644 index 0000000000000..a46ad42870342 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionIntentsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectionIntents; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntentResource; + +class BackupProtectionIntentsImpl extends WrapperImpl implements BackupProtectionIntents { + private final RecoveryServicesManager manager; + + BackupProtectionIntentsImpl(RecoveryServicesManager manager) { + super(manager.inner().backupProtectionIntents()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private ProtectionIntentResourceImpl wrapModel(ProtectionIntentResourceInner inner) { + return new ProtectionIntentResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName) { + BackupProtectionIntentsInner 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 ProtectionIntentResource call(ProtectionIntentResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionIntentsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionIntentsInner.java new file mode 100644 index 0000000000000..55d915c98c9ac --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupProtectionIntentsInner.java @@ -0,0 +1,429 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 BackupProtectionIntents. + */ +public class BackupProtectionIntentsInner { + /** The Retrofit service to perform REST calls. */ + private BackupProtectionIntentsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupProtectionIntentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupProtectionIntentsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupProtectionIntentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupProtectionIntents to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupProtectionIntentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectionIntents list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents") + 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.v2020_02_02.BackupProtectionIntents listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a pageable list of all intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectionIntentResourceInner> 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."); + } + final String apiVersion = "2017-07-01"; + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + ServiceResponse> * @param vaultName The name of the recovery services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group where the recovery services vault is present. + ServiceResponse> * @param filter OData filter options. + ServiceResponse> * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectionIntentResourceInner> 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."); + } + final String apiVersion = "2017-07-01"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), 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 all intents that are present within a vault. + * + * @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<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + * @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 intents that are present within a vault. + * + * @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<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + * @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<ProtectionIntentResourceInner> 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 intents that are present within a vault. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectionIntentResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigInner.java new file mode 100644 index 0000000000000..a2bf38935cb6d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.StorageType; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.StorageTypeState; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.EnhancedSecurityState; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.SoftDeleteFeatureState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Backup resource vault config details. + */ +public class BackupResourceVaultConfigInner { + /** + * Storage type. Possible values include: 'Invalid', 'GeoRedundant', + * 'LocallyRedundant', 'ZoneRedundant', 'ReadAccessGeoZoneRedundant'. + */ + @JsonProperty(value = "storageModelType") + private StorageType storageModelType; + + /** + * Storage type. Possible values include: 'Invalid', 'GeoRedundant', + * 'LocallyRedundant', 'ZoneRedundant', 'ReadAccessGeoZoneRedundant'. + */ + @JsonProperty(value = "storageType") + private StorageType storageType; + + /** + * Locked or Unlocked. Once a machine is registered against a resource, the + * storageTypeState is always Locked. Possible values include: 'Invalid', + * 'Locked', 'Unlocked'. + */ + @JsonProperty(value = "storageTypeState") + private StorageTypeState storageTypeState; + + /** + * Enabled or Disabled. Possible values include: 'Invalid', 'Enabled', + * 'Disabled'. + */ + @JsonProperty(value = "enhancedSecurityState") + private EnhancedSecurityState enhancedSecurityState; + + /** + * Soft Delete feature state. Possible values include: 'Invalid', + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "softDeleteFeatureState") + private SoftDeleteFeatureState softDeleteFeatureState; + + /** + * Get storage type. Possible values include: 'Invalid', 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', 'ReadAccessGeoZoneRedundant'. + * + * @return the storageModelType value + */ + public StorageType storageModelType() { + return this.storageModelType; + } + + /** + * Set storage type. Possible values include: 'Invalid', 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', 'ReadAccessGeoZoneRedundant'. + * + * @param storageModelType the storageModelType value to set + * @return the BackupResourceVaultConfigInner object itself. + */ + public BackupResourceVaultConfigInner withStorageModelType(StorageType storageModelType) { + this.storageModelType = storageModelType; + return this; + } + + /** + * Get storage type. Possible values include: 'Invalid', 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', 'ReadAccessGeoZoneRedundant'. + * + * @return the storageType value + */ + public StorageType storageType() { + return this.storageType; + } + + /** + * Set storage type. Possible values include: 'Invalid', 'GeoRedundant', 'LocallyRedundant', 'ZoneRedundant', 'ReadAccessGeoZoneRedundant'. + * + * @param storageType the storageType value to set + * @return the BackupResourceVaultConfigInner object itself. + */ + public BackupResourceVaultConfigInner withStorageType(StorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'Invalid', 'Locked', 'Unlocked'. + * + * @return the storageTypeState value + */ + public StorageTypeState storageTypeState() { + return this.storageTypeState; + } + + /** + * Set locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. Possible values include: 'Invalid', 'Locked', 'Unlocked'. + * + * @param storageTypeState the storageTypeState value to set + * @return the BackupResourceVaultConfigInner object itself. + */ + public BackupResourceVaultConfigInner withStorageTypeState(StorageTypeState storageTypeState) { + this.storageTypeState = storageTypeState; + return this; + } + + /** + * Get enabled or Disabled. Possible values include: 'Invalid', 'Enabled', 'Disabled'. + * + * @return the enhancedSecurityState value + */ + public EnhancedSecurityState enhancedSecurityState() { + return this.enhancedSecurityState; + } + + /** + * Set enabled or Disabled. Possible values include: 'Invalid', 'Enabled', 'Disabled'. + * + * @param enhancedSecurityState the enhancedSecurityState value to set + * @return the BackupResourceVaultConfigInner object itself. + */ + public BackupResourceVaultConfigInner withEnhancedSecurityState(EnhancedSecurityState enhancedSecurityState) { + this.enhancedSecurityState = enhancedSecurityState; + return this; + } + + /** + * Get soft Delete feature state. Possible values include: 'Invalid', 'Enabled', 'Disabled'. + * + * @return the softDeleteFeatureState value + */ + public SoftDeleteFeatureState softDeleteFeatureState() { + return this.softDeleteFeatureState; + } + + /** + * Set soft Delete feature state. Possible values include: 'Invalid', 'Enabled', 'Disabled'. + * + * @param softDeleteFeatureState the softDeleteFeatureState value to set + * @return the BackupResourceVaultConfigInner object itself. + */ + public BackupResourceVaultConfigInner withSoftDeleteFeatureState(SoftDeleteFeatureState softDeleteFeatureState) { + this.softDeleteFeatureState = softDeleteFeatureState; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigResourceImpl.java new file mode 100644 index 0000000000000..bddfca22f99d7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigResourceImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupResourceVaultConfigResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class BackupResourceVaultConfigResourceImpl extends WrapperImpl implements BackupResourceVaultConfigResource { + private final RecoveryServicesManager manager; + BackupResourceVaultConfigResourceImpl(BackupResourceVaultConfigResourceInner 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 BackupResourceVaultConfigInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigResourceInner.java new file mode 100644 index 0000000000000..a99de9ff00637 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Backup resource vault config details. + */ +@SkipParentValidation +public class BackupResourceVaultConfigResourceInner extends Resource { + /** + * BackupResourceVaultConfigResource properties. + */ + @JsonProperty(value = "properties") + private BackupResourceVaultConfigInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get backupResourceVaultConfigResource properties. + * + * @return the properties value + */ + public BackupResourceVaultConfigInner properties() { + return this.properties; + } + + /** + * Set backupResourceVaultConfigResource properties. + * + * @param properties the properties value to set + * @return the BackupResourceVaultConfigResourceInner object itself. + */ + public BackupResourceVaultConfigResourceInner withProperties(BackupResourceVaultConfigInner 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 BackupResourceVaultConfigResourceInner object itself. + */ + public BackupResourceVaultConfigResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigsImpl.java new file mode 100644 index 0000000000000..af6285c1329d5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigsImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupResourceVaultConfigs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupResourceVaultConfigResource; + +class BackupResourceVaultConfigsImpl extends WrapperImpl implements BackupResourceVaultConfigs { + private final RecoveryServicesManager manager; + + BackupResourceVaultConfigsImpl(RecoveryServicesManager manager) { + super(manager.inner().backupResourceVaultConfigs()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName) { + BackupResourceVaultConfigsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName) + .map(new Func1() { + @Override + public BackupResourceVaultConfigResource call(BackupResourceVaultConfigResourceInner inner) { + return new BackupResourceVaultConfigResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + BackupResourceVaultConfigsInner client = this.inner(); + return client.updateAsync(vaultName, resourceGroupName, parameters) + .map(new Func1() { + @Override + public BackupResourceVaultConfigResource call(BackupResourceVaultConfigResourceInner inner) { + return new BackupResourceVaultConfigResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable putAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + BackupResourceVaultConfigsInner client = this.inner(); + return client.putAsync(vaultName, resourceGroupName, parameters) + .map(new Func1() { + @Override + public BackupResourceVaultConfigResource call(BackupResourceVaultConfigResourceInner inner) { + return new BackupResourceVaultConfigResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigsInner.java new file mode 100644 index 0000000000000..450fa757de870 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupResourceVaultConfigsInner.java @@ -0,0 +1,343 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ErrorResponseException; +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.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +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 BackupResourceVaultConfigs. + */ +public class BackupResourceVaultConfigsInner { + /** The Retrofit service to perform REST calls. */ + private BackupResourceVaultConfigsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupResourceVaultConfigsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupResourceVaultConfigsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupResourceVaultConfigsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupResourceVaultConfigs to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupResourceVaultConfigsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupResourceVaultConfigs get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupResourceVaultConfigs update" }) + @PATCH("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") + Observable> update(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body BackupResourceVaultConfigResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupResourceVaultConfigs put" }) + @PUT("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") + Observable> put(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body BackupResourceVaultConfigResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 BackupResourceVaultConfigResourceInner object if successful. + */ + public BackupResourceVaultConfigResourceInner get(String vaultName, String resourceGroupName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName), serviceCallback); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupResourceVaultConfigResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1, BackupResourceVaultConfigResourceInner>() { + @Override + public BackupResourceVaultConfigResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Fetches resource vault config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupResourceVaultConfigResourceInner object + */ + public Observable> getWithServiceResponseAsync(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."); + } + final String apiVersion = "2019-06-15"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), 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); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupResourceVaultConfigResourceInner object if successful. + */ + public BackupResourceVaultConfigResourceInner update(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return updateWithServiceResponseAsync(vaultName, resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config 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 updateAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(vaultName, resourceGroupName, parameters), serviceCallback); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupResourceVaultConfigResourceInner object + */ + public Observable updateAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return updateWithServiceResponseAsync(vaultName, resourceGroupName, parameters).map(new Func1, BackupResourceVaultConfigResourceInner>() { + @Override + public BackupResourceVaultConfigResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupResourceVaultConfigResourceInner object + */ + public Observable> updateWithServiceResponseAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-06-15"; + return service.update(vaultName, resourceGroupName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupResourceVaultConfigResourceInner object if successful. + */ + public BackupResourceVaultConfigResourceInner put(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return putWithServiceResponseAsync(vaultName, resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config 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 putAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(vaultName, resourceGroupName, parameters), serviceCallback); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupResourceVaultConfigResourceInner object + */ + public Observable putAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + return putWithServiceResponseAsync(vaultName, resourceGroupName, parameters).map(new Func1, BackupResourceVaultConfigResourceInner>() { + @Override + public BackupResourceVaultConfigResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates vault security config. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource config request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupResourceVaultConfigResourceInner object + */ + public Observable> putWithServiceResponseAsync(String vaultName, String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-06-15"; + return service.put(vaultName, resourceGroupName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusImpl.java new file mode 100644 index 0000000000000..569922923fc33 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusImpl.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupStatus; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupStatusResponse; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupStatusRequest; + +class BackupStatusImpl extends WrapperImpl implements BackupStatus { + private final RecoveryServicesManager manager; + + BackupStatusImpl(RecoveryServicesManager manager) { + super(manager.inner().backupStatus()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String azureRegion, BackupStatusRequest parameters) { + BackupStatusInner client = this.inner(); + return client.getAsync(azureRegion, parameters) + .map(new Func1() { + @Override + public BackupStatusResponse call(BackupStatusResponseInner inner) { + return new BackupStatusResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusInner.java new file mode 100644 index 0000000000000..acef007850cbb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupStatusRequest; +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 BackupStatus. + */ +public class BackupStatusInner { + /** The Retrofit service to perform REST calls. */ + private BackupStatusService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupStatusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupStatusInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupStatusService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupStatus to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupStatusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupStatus get" }) + @POST("Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus") + Observable> get(@Path("azureRegion") String azureRegion, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body BackupStatusRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api + * @param parameters Container Backup Status Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupStatusResponseInner object if successful. + */ + public BackupStatusResponseInner get(String azureRegion, BackupStatusRequest parameters) { + return getWithServiceResponseAsync(azureRegion, parameters).toBlocking().single().body(); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api + * @param parameters Container Backup Status 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 getAsync(String azureRegion, BackupStatusRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(azureRegion, parameters), serviceCallback); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api + * @param parameters Container Backup Status Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupStatusResponseInner object + */ + public Observable getAsync(String azureRegion, BackupStatusRequest parameters) { + return getWithServiceResponseAsync(azureRegion, parameters).map(new Func1, BackupStatusResponseInner>() { + @Override + public BackupStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the container backup status. + * + * @param azureRegion Azure region to hit Api + * @param parameters Container Backup Status Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupStatusResponseInner object + */ + public Observable> getWithServiceResponseAsync(String azureRegion, BackupStatusRequest parameters) { + if (azureRegion == null) { + throw new IllegalArgumentException("Parameter azureRegion 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01"; + return service.get(azureRegion, this.client.subscriptionId(), apiVersion, parameters, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusResponseImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusResponseImpl.java new file mode 100644 index 0000000000000..950f07c0e1dbf --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusResponseImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.FabricName; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionStatus; + +class BackupStatusResponseImpl extends WrapperImpl implements BackupStatusResponse { + private final RecoveryServicesManager manager; + BackupStatusResponseImpl(BackupStatusResponseInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public String containerName() { + return this.inner().containerName(); + } + + @Override + public String errorCode() { + return this.inner().errorCode(); + } + + @Override + public String errorMessage() { + return this.inner().errorMessage(); + } + + @Override + public FabricName fabricName() { + return this.inner().fabricName(); + } + + @Override + public String policyName() { + return this.inner().policyName(); + } + + @Override + public String protectedItemName() { + return this.inner().protectedItemName(); + } + + @Override + public ProtectionStatus protectionStatus() { + return this.inner().protectionStatus(); + } + + @Override + public String registrationStatus() { + return this.inner().registrationStatus(); + } + + @Override + public String vaultId() { + return this.inner().vaultId(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusResponseInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusResponseInner.java new file mode 100644 index 0000000000000..8119de97e5f33 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupStatusResponseInner.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionStatus; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.FabricName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BackupStatus response. + */ +public class BackupStatusResponseInner { + /** + * Specifies whether the container is registered or not. Possible values + * include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', + * 'ProtectionFailed'. + */ + @JsonProperty(value = "protectionStatus") + private ProtectionStatus protectionStatus; + + /** + * Specifies the arm resource id of the vault. + */ + @JsonProperty(value = "vaultId") + private String vaultId; + + /** + * Specifies the fabric name - Azure or AD. Possible values include: + * 'Invalid', 'Azure'. + */ + @JsonProperty(value = "fabricName") + private FabricName fabricName; + + /** + * Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;csname;vmname. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;csname;vmname. + */ + @JsonProperty(value = "protectedItemName") + private String protectedItemName; + + /** + * ErrorCode in case of intent failed. + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /** + * ErrorMessage in case of intent failed. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Specifies the policy name which is used for protection. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Container registration status. + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /** + * Get specifies whether the container is registered or not. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @return the protectionStatus value + */ + public ProtectionStatus protectionStatus() { + return this.protectionStatus; + } + + /** + * Set specifies whether the container is registered or not. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @param protectionStatus the protectionStatus value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withProtectionStatus(ProtectionStatus protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get specifies the arm resource id of the vault. + * + * @return the vaultId value + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Set specifies the arm resource id of the vault. + * + * @param vaultId the vaultId value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withVaultId(String vaultId) { + this.vaultId = vaultId; + return this; + } + + /** + * Get specifies the fabric name - Azure or AD. Possible values include: 'Invalid', 'Azure'. + * + * @return the fabricName value + */ + public FabricName fabricName() { + return this.fabricName; + } + + /** + * Set specifies the fabric name - Azure or AD. Possible values include: 'Invalid', 'Azure'. + * + * @param fabricName the fabricName value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withFabricName(FabricName fabricName) { + this.fabricName = fabricName; + return this; + } + + /** + * Get specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. + * + * @param containerName the containerName value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + * + * @return the protectedItemName value + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Set specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. + * + * @param protectedItemName the protectedItemName value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withProtectedItemName(String protectedItemName) { + this.protectedItemName = protectedItemName; + return this; + } + + /** + * Get errorCode in case of intent failed. + * + * @return the errorCode value + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set errorCode in case of intent failed. + * + * @param errorCode the errorCode value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get errorMessage in case of intent failed. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set errorMessage in case of intent failed. + * + * @param errorMessage the errorMessage value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get specifies the policy name which is used for protection. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set specifies the policy name which is used for protection. + * + * @param policyName the policyName value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get container registration status. + * + * @return the registrationStatus value + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set container registration status. + * + * @param registrationStatus the registrationStatus value to set + * @return the BackupStatusResponseInner object itself. + */ + public BackupStatusResponseInner withRegistrationStatus(String registrationStatus) { + this.registrationStatus = registrationStatus; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupUsageSummariesImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupUsageSummariesImpl.java new file mode 100644 index 0000000000000..edb11abc86364 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupUsageSummariesImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupUsageSummaries; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupManagementUsage; + +class BackupUsageSummariesImpl extends WrapperImpl implements BackupUsageSummaries { + private final RecoveryServicesManager manager; + + BackupUsageSummariesImpl(RecoveryServicesManager manager) { + super(manager.inner().backupUsageSummaries()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private BackupManagementUsageImpl wrapModel(BackupManagementUsageInner inner) { + return new BackupManagementUsageImpl(inner, manager()); + } + + @Override + public Observable listAsync(String vaultName, String resourceGroupName) { + BackupUsageSummariesInner 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 BackupManagementUsage call(BackupManagementUsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupUsageSummariesInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupUsageSummariesInner.java new file mode 100644 index 0000000000000..36cc96aa23a8b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupUsageSummariesInner.java @@ -0,0 +1,244 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 BackupUsageSummaries. + */ +public class BackupUsageSummariesInner { + /** The Retrofit service to perform REST calls. */ + private BackupUsageSummariesService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupUsageSummariesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupUsageSummariesInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupUsageSummariesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupUsageSummaries to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupUsageSummariesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupUsageSummaries list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries") + 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); + + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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<BackupManagementUsageInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupManagementUsageInner> 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(); + } + }); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupManagementUsageInner> 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."); + } + final String apiVersion = "2017-07-01"; + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), apiVersion, filter, skipToken, 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); + } + } + }); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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 List<BackupManagementUsageInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName, String filter, String skipToken) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken).toBlocking().single().body(); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken 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(String vaultName, String resourceGroupName, String filter, String skipToken, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken), serviceCallback); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupManagementUsageInner> object + */ + public Observable> listAsync(String vaultName, String resourceGroupName, String filter, String skipToken) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Fetches the backup management usage summaries of the vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupManagementUsageInner> object + */ + public Observable>> listWithServiceResponseAsync(String vaultName, String resourceGroupName, String filter, 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."); + } + final String apiVersion = "2017-07-01"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), apiVersion, filter, skipToken, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupWorkloadItemsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupWorkloadItemsImpl.java new file mode 100644 index 0000000000000..4d62c5c05629c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupWorkloadItemsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupWorkloadItems; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.WorkloadItemResource; + +class BackupWorkloadItemsImpl extends WrapperImpl implements BackupWorkloadItems { + private final RecoveryServicesManager manager; + + BackupWorkloadItemsImpl(RecoveryServicesManager manager) { + super(manager.inner().backupWorkloadItems()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private WorkloadItemResourceImpl wrapModel(WorkloadItemResourceInner inner) { + return new WorkloadItemResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName) { + BackupWorkloadItemsInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName, fabricName, containerName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadItemResource call(WorkloadItemResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupWorkloadItemsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupWorkloadItemsInner.java new file mode 100644 index 0000000000000..bf05db42e32e4 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/BackupWorkloadItemsInner.java @@ -0,0 +1,476 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 BackupWorkloadItems. + */ +public class BackupWorkloadItemsInner { + /** The Retrofit service to perform REST calls. */ + private BackupWorkloadItemsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupWorkloadItemsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupWorkloadItemsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupWorkloadItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupWorkloadItems to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupWorkloadItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupWorkloadItems list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items") + Observable> list(@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, @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.v2020_02_02.BackupWorkloadItems listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of 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 + * @return the PagedList<WorkloadItemResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of 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> listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadItemResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadItemResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName) { + return listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName) + .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 workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadItemResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final String fabricName, final 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."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, 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 workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken 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<WorkloadItemResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName, final String filter, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, 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 workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken 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 fabricName, final String containerName, final String filter, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadItemResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName, final String filter, final String skipToken) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Provides a pageable list of workload item of a specific container according to the query filter and the pagination + parameters. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadItemResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName, final String filter, final String skipToken) { + return listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, 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 workload item of a specific container according to the query filter and the pagination + parameters. + * + ServiceResponse> * @param vaultName The name of the recovery services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group where the recovery services vault is present. + ServiceResponse> * @param fabricName Fabric name associated with the container. + ServiceResponse> * @param containerName Name of the container. + ServiceResponse> * @param filter OData filter options. + ServiceResponse> * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadItemResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String containerName, 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 (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."); + } + final String apiVersion = "2016-12-01"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, 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 workload item of a specific container according to the query filter and the pagination + parameters. + * + * @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<WorkloadItemResourceInner> 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 workload item of a specific container according to the query filter and the pagination + parameters. + * + * @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 workload item of a specific container according to the query filter and the pagination + parameters. + * + * @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<WorkloadItemResourceInner> 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 workload item of a specific container according to the query filter and the pagination + parameters. + * + * @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<WorkloadItemResourceInner> 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 workload item of a specific container according to the query filter and the pagination + parameters. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadItemResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ClientDiscoveryValueForSingleApiImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ClientDiscoveryValueForSingleApiImpl.java new file mode 100644 index 0000000000000..2749257ab2420 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ClientDiscoveryValueForSingleApiImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ClientDiscoveryValueForSingleApi; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ClientDiscoveryDisplay; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ClientDiscoveryForProperties; + +class ClientDiscoveryValueForSingleApiImpl extends WrapperImpl implements ClientDiscoveryValueForSingleApi { + private final RecoveryServicesManager manager; + ClientDiscoveryValueForSingleApiImpl(ClientDiscoveryValueForSingleApiInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public ClientDiscoveryDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public ClientDiscoveryForProperties properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ClientDiscoveryValueForSingleApiInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ClientDiscoveryValueForSingleApiInner.java new file mode 100644 index 0000000000000..2d95d7e9842bb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ClientDiscoveryValueForSingleApiInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ClientDiscoveryDisplay; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ClientDiscoveryForProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Available operation details. + */ +public class ClientDiscoveryValueForSingleApiInner { + /** + * Name of the Operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Contains the localized display information for this particular + * operation. + */ + @JsonProperty(value = "display") + private ClientDiscoveryDisplay display; + + /** + * The intended executor of the operation;governs the display of the + * operation in the RBAC UX and the audit logs UX. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * ShoeBox properties for the given operation. + */ + @JsonProperty(value = "properties") + private ClientDiscoveryForProperties properties; + + /** + * 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 ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get contains the localized display information for this particular operation. + * + * @return the display value + */ + public ClientDiscoveryDisplay display() { + return this.display; + } + + /** + * Set contains the localized display information for this particular operation. + * + * @param display the display value to set + * @return the ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withDisplay(ClientDiscoveryDisplay display) { + this.display = display; + return this; + } + + /** + * Get the intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX. + * + * @param origin the origin value to set + * @return the ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get shoeBox properties for the given operation. + * + * @return the properties value + */ + public ClientDiscoveryForProperties properties() { + return this.properties; + } + + /** + * Set shoeBox properties for the given operation. + * + * @param properties the properties value to set + * @return the ClientDiscoveryValueForSingleApiInner object itself. + */ + public ClientDiscoveryValueForSingleApiInner withProperties(ClientDiscoveryForProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ExportJobsOperationResultsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ExportJobsOperationResultsImpl.java new file mode 100644 index 0000000000000..45f109e29f751 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ExportJobsOperationResults; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ExportJobsOperationResultsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ExportJobsOperationResultsInner.java new file mode 100644 index 0000000000000..6231cecf79547 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ExportJobsOperationResultsInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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 operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents 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 operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents 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 operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents 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 operation result of operation triggered by Export Jobs API. If the operation is successful, then it also + contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized format. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param operationId OperationID which represents 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."); + } + final String apiVersion = "2019-06-15"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/FeatureSupportsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/FeatureSupportsImpl.java new file mode 100644 index 0000000000000..7da8b19c80001 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/FeatureSupportsImpl.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.FeatureSupports; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.AzureVMResourceFeatureSupportResponse; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.FeatureSupportRequest; + +class FeatureSupportsImpl extends WrapperImpl implements FeatureSupports { + private final RecoveryServicesManager manager; + + FeatureSupportsImpl(RecoveryServicesManager manager) { + super(manager.inner().featureSupports()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable validateAsync(String azureRegion, FeatureSupportRequest parameters) { + FeatureSupportsInner client = this.inner(); + return client.validateAsync(azureRegion, parameters) + .map(new Func1() { + @Override + public AzureVMResourceFeatureSupportResponse call(AzureVMResourceFeatureSupportResponseInner inner) { + return new AzureVMResourceFeatureSupportResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/FeatureSupportsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/FeatureSupportsInner.java new file mode 100644 index 0000000000000..e543c53e52bdd --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/FeatureSupportsInner.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.FeatureSupportRequest; +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 FeatureSupports. + */ +public class FeatureSupportsInner { + /** The Retrofit service to perform REST calls. */ + private FeatureSupportsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of FeatureSupportsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FeatureSupportsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(FeatureSupportsService.class); + this.client = client; + } + + /** + * The interface defining all the services for FeatureSupports to be + * used by Retrofit to perform actually REST calls. + */ + interface FeatureSupportsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.FeatureSupports validate" }) + @POST("Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures") + Observable> validate(@Path("azureRegion") String azureRegion, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body FeatureSupportRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api + * @param parameters Feature support request object + * @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 AzureVMResourceFeatureSupportResponseInner object if successful. + */ + public AzureVMResourceFeatureSupportResponseInner validate(String azureRegion, FeatureSupportRequest parameters) { + return validateWithServiceResponseAsync(azureRegion, parameters).toBlocking().single().body(); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api + * @param parameters Feature support request object + * @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 validateAsync(String azureRegion, FeatureSupportRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(azureRegion, parameters), serviceCallback); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api + * @param parameters Feature support request object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureVMResourceFeatureSupportResponseInner object + */ + public Observable validateAsync(String azureRegion, FeatureSupportRequest parameters) { + return validateWithServiceResponseAsync(azureRegion, parameters).map(new Func1, AzureVMResourceFeatureSupportResponseInner>() { + @Override + public AzureVMResourceFeatureSupportResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * It will validate if given feature with resource properties is supported in service. + * + * @param azureRegion Azure region to hit Api + * @param parameters Feature support request object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AzureVMResourceFeatureSupportResponseInner object + */ + public Observable> validateWithServiceResponseAsync(String azureRegion, FeatureSupportRequest parameters) { + if (azureRegion == null) { + throw new IllegalArgumentException("Parameter azureRegion 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01"; + return service.validate(azureRegion, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateDelegate(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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/IdParsingUtils.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..6e1c85de5e96d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ItemLevelRecoveryConnectionsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ItemLevelRecoveryConnectionsImpl.java new file mode 100644 index 0000000000000..d460043d3b383 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ItemLevelRecoveryConnections; +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 provisionAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource parameters) { + ItemLevelRecoveryConnectionsInner client = this.inner(); + return client.provisionAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).toCompletable(); + } + + @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(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ItemLevelRecoveryConnectionsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ItemLevelRecoveryConnectionsInner.java new file mode 100644 index 0000000000000..2b6a375a95660 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ItemLevelRecoveryConnectionsInner.java @@ -0,0 +1,319 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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 parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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); + + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status of + provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + for this backed up data. + * @param parameters resource 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 parameters) { + provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).toBlocking().single().body(); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status of + provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + for this backed up data. + * @param parameters resource 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 parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters), serviceCallback); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file + explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status of + provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + for this backed up data. + * @param parameters resource 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 parameters) { + return provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).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 a file + explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status of + provisioning, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be provisioned + for this backed up data. + * @param parameters resource 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 parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2016-12-01"; + return service.provision(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, apiVersion, parameters, 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); + } + + /** + * 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + this backed up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + this backed up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + this backed up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose files/folders are to be restored. + * @param recoveryPointId Recovery point ID which represents backed up data. iSCSI connection will be revoked for + this backed up 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."); + } + final String apiVersion = "2016-12-01"; + return service.revoke(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, 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); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobCancellationsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobCancellationsImpl.java new file mode 100644 index 0000000000000..5545db54ee9e3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobCancellationsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobCancellationsInner.java new file mode 100644 index 0000000000000..f66d4f4940a89 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobCancellationsInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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 a job. This is an asynchronous operation. To know the status of the cancellation, call + GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 a job. This is an asynchronous operation. To know the status of the cancellation, call + GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 a job. This is an asynchronous operation. To know the status of the cancellation, call + GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 a job. This is an asynchronous operation. To know the status of the cancellation, call + GetCancelOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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."); + } + final String apiVersion = "2019-06-15"; + return service.trigger(vaultName, resourceGroupName, this.client.subscriptionId(), jobName, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobDetailsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobDetailsImpl.java new file mode 100644 index 0000000000000..237ce9d49f4a7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobDetailsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.JobDetails; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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) + .flatMap(new Func1>() { + @Override + public Observable call(JobResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VaultJobResourceModel)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobDetailsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobDetailsInner.java new file mode 100644 index 0000000000000..5df203903d5b2 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobDetailsInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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 where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @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 where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @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 where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @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 where the recovery services vault is present. + * @param jobName Name of the job whose details are to be fetched. + * @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."); + } + final String apiVersion = "2019-06-15"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), jobName, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobInner.java new file mode 100644 index 0000000000000..ba318c14409aa --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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", defaultImpl = JobInner.class) +@JsonTypeName("Job") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureIaaSVMJob", value = AzureIaaSVMJob.class), + @JsonSubTypes.Type(name = "AzureStorageJob", value = AzureStorageJob.class), + @JsonSubTypes.Type(name = "AzureWorkloadJob", value = AzureWorkloadJob.class), + @JsonSubTypes.Type(name = "DpmJob", value = DpmJob.class), + @JsonSubTypes.Type(name = "MabJob", value = MabJob.class) +}) +public class JobInner { + /** + * Friendly name of the entity on which the current job is executing. + */ + @JsonProperty(value = "entityFriendlyName") + private String entityFriendlyName; + + /** + * Backup management type to execute the current job. Possible values + * include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', + * 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * 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 friendly name of the entity on which the current job is executing. + * + * @return the entityFriendlyName value + */ + public String entityFriendlyName() { + return this.entityFriendlyName; + } + + /** + * Set 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 backup management type to execute the current job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set backup management type to execute the current job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @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 job status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobOperationResultsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobOperationResultsImpl.java new file mode 100644 index 0000000000000..a8262821fae09 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobOperationResultsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobOperationResultsInner.java new file mode 100644 index 0000000000000..5ab0b42b947f3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobOperationResultsInner.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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); + + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @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(); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @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); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @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(); + } + }); + } + + /** + * Fetches the result of any operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param jobName Job name whose operation result has to be fetched. + * @param operationId OperationID which represents the operation whose result has to be fetched. + * @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."); + } + final String apiVersion = "2019-06-15"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), jobName, operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobResourceInner.java new file mode 100644 index 0000000000000..63fc10a0f4535 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Defines workload agnostic properties for a job. + */ +@SkipParentValidation +public class JobResourceInner extends Resource { + /** + * JobResource properties. + */ + @JsonProperty(value = "properties") + private JobInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get jobResource properties. + * + * @return the properties value + */ + public JobInner properties() { + return this.properties; + } + + /** + * Set jobResource properties. + * + * @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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobsImpl.java new file mode 100644 index 0000000000000..ed80035829ceb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.Jobs; +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; + } + + @Override + public Completable exportAsync(String vaultName, String resourceGroupName) { + JobsInner client = this.inner(); + return client.exportAsync(vaultName, resourceGroupName).toCompletable(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobsInner.java new file mode 100644 index 0000000000000..9e1844acd730e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/JobsInner.java @@ -0,0 +1,226 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 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.v2020_02_02.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); + + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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(); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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(); + } + }); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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."); + } + final String apiVersion = "2019-06-15"; + final String filter = null; + return service.export(vaultName, resourceGroupName, this.client.subscriptionId(), 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); + } + } + }); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @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(); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @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); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @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(); + } + }); + } + + /** + * Triggers export of jobs specified by filters and returns an OperationID to track. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param filter OData filter options. + * @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."); + } + final String apiVersion = "2019-06-15"; + return service.export(vaultName, resourceGroupName, this.client.subscriptionId(), 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); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationResultInfoBaseResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationResultInfoBaseResourceImpl.java new file mode 100644 index 0000000000000..a534a30caa393 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationResultInfoBaseResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationResultInfoBase; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 operation() { + return this.inner().operation(); + } + + @Override + public HttpStatusCode statusCode() { + return this.inner().statusCode(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationResultInfoBaseResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationResultInfoBaseResourceInner.java new file mode 100644 index 0000000000000..684cd1d4cdf24 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationResultInfoBase; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationWorkerResponse; + +/** + * Base class for operation result info. + */ +public class OperationResultInfoBaseResourceInner extends OperationWorkerResponse { + /** + * OperationResultInfoBaseResource operation. + */ + @JsonProperty(value = "operation") + private OperationResultInfoBase operation; + + /** + * Get operationResultInfoBaseResource operation. + * + * @return the operation value + */ + public OperationResultInfoBase operation() { + return this.operation; + } + + /** + * Set operationResultInfoBaseResource operation. + * + * @param operation the operation value to set + * @return the OperationResultInfoBaseResourceInner object itself. + */ + public OperationResultInfoBaseResourceInner withOperation(OperationResultInfoBase operation) { + this.operation = operation; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationStatusInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationStatusInner.java new file mode 100644 index 0000000000000..7329bb6acfc51 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusValues; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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; + + /** + * Operation start time. Format: ISO-8601. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * Operation end time. Format: 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 operation start time. Format: ISO-8601. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set operation start time. Format: 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 operation end time. Format: ISO-8601. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set operation end time. Format: 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..b6d2f90ef8af0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationsImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidateOperationsResponse; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ClientDiscoveryValueForSingleApi; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidateOperationRequest; + +class OperationsImpl extends WrapperImpl implements Operations { + private final RecoveryServicesManager manager; + + OperationsImpl(RecoveryServicesManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable validateAsync(String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + OperationsInner client = this.inner(); + return client.validateAsync(vaultName, resourceGroupName, parameters) + .map(new Func1() { + @Override + public ValidateOperationsResponse call(ValidateOperationsResponseInner inner) { + return new ValidateOperationsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ClientDiscoveryValueForSingleApi call(ClientDiscoveryValueForSingleApiInner inner) { + return new ClientDiscoveryValueForSingleApiImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationsInner.java new file mode 100644 index 0000000000000..ce87ece17841d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/OperationsInner.java @@ -0,0 +1,385 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidateOperationRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.Operations validate" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation") + Observable> validate(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ValidateOperationRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.Operations list" }) + @GET("providers/Microsoft.RecoveryServices/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ValidateOperationsResponseInner object if successful. + */ + public ValidateOperationsResponseInner validate(String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + return validateWithServiceResponseAsync(vaultName, resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation 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 validateAsync(String vaultName, String resourceGroupName, ValidateOperationRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(vaultName, resourceGroupName, parameters), serviceCallback); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateOperationsResponseInner object + */ + public Observable validateAsync(String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + return validateWithServiceResponseAsync(vaultName, resourceGroupName, parameters).map(new Func1, ValidateOperationsResponseInner>() { + @Override + public ValidateOperationsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validate operation for specified backed up item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param parameters resource validate operation request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ValidateOperationsResponseInner object + */ + public Observable> validateWithServiceResponseAsync(String vaultName, String resourceGroupName, ValidateOperationRequest parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-06-15"; + return service.validate(vaultName, resourceGroupName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateDelegate(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); + } + + /** + * Returns the list of available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClientDiscoveryValueForSingleApiInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns the list of available operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns the list of available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClientDiscoveryValueForSingleApiInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClientDiscoveryValueForSingleApiInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns the list of available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClientDiscoveryValueForSingleApiInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2016-08-10"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the list of available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClientDiscoveryValueForSingleApiInner> 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(); + } + }; + } + + /** + * Returns the list of available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns the list of available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClientDiscoveryValueForSingleApiInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClientDiscoveryValueForSingleApiInner> 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)); + } + }); + } + + /** + * Returns the list of available operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClientDiscoveryValueForSingleApiInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PageImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PageImpl.java new file mode 100644 index 0000000000000..8d21129d0bd66 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PageImpl1.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PageImpl1.java new file mode 100644 index 0000000000000..5984194743824 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PreValidateEnableBackupResponseImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PreValidateEnableBackupResponseImpl.java new file mode 100644 index 0000000000000..e5aacc95b43b6 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PreValidateEnableBackupResponseImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PreValidateEnableBackupResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidationStatus; + +class PreValidateEnableBackupResponseImpl extends WrapperImpl implements PreValidateEnableBackupResponse { + private final RecoveryServicesManager manager; + PreValidateEnableBackupResponseImpl(PreValidateEnableBackupResponseInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public String containerName() { + return this.inner().containerName(); + } + + @Override + public String errorCode() { + return this.inner().errorCode(); + } + + @Override + public String errorMessage() { + return this.inner().errorMessage(); + } + + @Override + public String protectedItemName() { + return this.inner().protectedItemName(); + } + + @Override + public String recommendation() { + return this.inner().recommendation(); + } + + @Override + public ValidationStatus status() { + return this.inner().status(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PreValidateEnableBackupResponseInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PreValidateEnableBackupResponseInner.java new file mode 100644 index 0000000000000..9db858a25e648 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PreValidateEnableBackupResponseInner.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response contract for enable backup validation request. + */ +public class PreValidateEnableBackupResponseInner { + /** + * Validation Status. Possible values include: 'Invalid', 'Succeeded', + * 'Failed'. + */ + @JsonProperty(value = "status") + private ValidationStatus status; + + /** + * Response error code. + */ + @JsonProperty(value = "errorCode") + private String errorCode; + + /** + * Response error message. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Recommended action for user. + */ + @JsonProperty(value = "recommendation") + private String recommendation; + + /** + * Specifies the product specific container name. E.g. + * iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + * for portal. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * Specifies the product specific ds name. E.g. + * vm;iaasvmcontainer;rgname;vmname. This is required for portal. + */ + @JsonProperty(value = "protectedItemName") + private String protectedItemName; + + /** + * Get validation Status. Possible values include: 'Invalid', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Set validation Status. Possible values include: 'Invalid', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withStatus(ValidationStatus status) { + this.status = status; + return this; + } + + /** + * Get response error code. + * + * @return the errorCode value + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set response error code. + * + * @param errorCode the errorCode value to set + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get response error message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set response error message. + * + * @param errorMessage the errorMessage value to set + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get recommended action for user. + * + * @return the recommendation value + */ + public String recommendation() { + return this.recommendation; + } + + /** + * Set recommended action for user. + * + * @param recommendation the recommendation value to set + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withRecommendation(String recommendation) { + this.recommendation = recommendation; + return this; + } + + /** + * Get specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + for portal. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + for portal. + * + * @param containerName the containerName value to set + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @return the protectedItemName value + */ + public String protectedItemName() { + return this.protectedItemName; + } + + /** + * Set specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal. + * + * @param protectedItemName the protectedItemName value to set + * @return the PreValidateEnableBackupResponseInner object itself. + */ + public PreValidateEnableBackupResponseInner withProtectedItemName(String protectedItemName) { + this.protectedItemName = protectedItemName; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..dc13b3cbc47be --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProvisioningState; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateEndpoint; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Private Endpoint Connection Response Properties. + */ +public class PrivateEndpointConnectionInner { + /** + * Gets or sets provisioning state of the private endpoint connection. + * Possible values include: 'Succeeded', 'Deleting', 'Failed', 'Pending'. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /** + * Gets or sets private endpoint associated with the private endpoint + * connection. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * Gets or sets private link service connection state. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get gets or sets provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Deleting', 'Failed', 'Pending'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set gets or sets provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Deleting', 'Failed', 'Pending'. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get gets or sets private endpoint associated with the private endpoint connection. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set gets or sets private endpoint associated with the private endpoint connection. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get gets or sets private link service connection state. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set gets or sets private link service connection state. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionResourceImpl.java new file mode 100644 index 0000000000000..feacc06402b6d --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionResourceImpl.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateEndpointConnectionResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; + +class PrivateEndpointConnectionResourceImpl extends CreatableUpdatableImpl implements PrivateEndpointConnectionResource, PrivateEndpointConnectionResource.Definition, PrivateEndpointConnectionResource.Update { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionResourceImpl(String name, RecoveryServicesManager manager) { + super(name, new PrivateEndpointConnectionResourceInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionResourceImpl(PrivateEndpointConnectionResourceInner inner, RecoveryServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.putAsync(this.vaultName, this.resourceGroupName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.putAsync(this.vaultName, this.resourceGroupName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.privateEndpointConnectionName); + } + + @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 PrivateEndpointConnectionInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionResourceImpl withExistingVault(String vaultName, String resourceGroupName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public PrivateEndpointConnectionResourceImpl withETag(String eTag) { + this.inner().withETag(eTag); + return this; + } + + @Override + public PrivateEndpointConnectionResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public PrivateEndpointConnectionResourceImpl withProperties(PrivateEndpointConnectionInner properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public PrivateEndpointConnectionResourceImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionResourceInner.java new file mode 100644 index 0000000000000..291cefb4043bb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Private Endpoint Connection Response Properties. + */ +@SkipParentValidation +public class PrivateEndpointConnectionResourceInner extends Resource { + /** + * PrivateEndpointConnectionResource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get privateEndpointConnectionResource properties. + * + * @return the properties value + */ + public PrivateEndpointConnectionInner properties() { + return this.properties; + } + + /** + * Set privateEndpointConnectionResource properties. + * + * @param properties the properties value to set + * @return the PrivateEndpointConnectionResourceInner object itself. + */ + public PrivateEndpointConnectionResourceInner withProperties(PrivateEndpointConnectionInner 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 PrivateEndpointConnectionResourceInner object itself. + */ + public PrivateEndpointConnectionResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..3959b9f772a4e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateEndpointConnectionResource; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final RecoveryServicesManager manager; + + PrivateEndpointConnectionsImpl(RecoveryServicesManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public PrivateEndpointConnectionResourceImpl define(String name) { + return wrapModel(name); + } + + private PrivateEndpointConnectionResourceImpl wrapModel(PrivateEndpointConnectionResourceInner inner) { + return new PrivateEndpointConnectionResourceImpl(inner, manager()); + } + + private PrivateEndpointConnectionResourceImpl wrapModel(String name) { + return new PrivateEndpointConnectionResourceImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnectionResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 0000000000000..d51180fbd4851 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,521 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ErrorResponseException; +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.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 PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateEndpointConnections get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.v2020_02_02.PrivateEndpointConnections put" }) + @PUT("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> put(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateEndpointConnections beginPut" }) + @PUT("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginPut(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PrivateEndpointConnections delete" }) + @HTTP(path = "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.v2020_02_02.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionResourceInner object if successful. + */ + public PrivateEndpointConnectionResourceInner get(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionResourceInner>() { + @Override + public PrivateEndpointConnectionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Private Endpoint Connection. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2020-02-02"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), privateEndpointConnectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 PrivateEndpointConnectionResourceInner object if successful. + */ + public PrivateEndpointConnectionResourceInner put(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + return putWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 putAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters), serviceCallback); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + return putWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).map(new Func1, PrivateEndpointConnectionResourceInner>() { + @Override + public PrivateEndpointConnectionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putWithServiceResponseAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2020-02-02"; + Observable> observable = service.put(vaultName, resourceGroupName, this.client.subscriptionId(), privateEndpointConnectionName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 PrivateEndpointConnectionResourceInner object if successful. + */ + public PrivateEndpointConnectionResourceInner beginPut(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + return beginPutWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for 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 beginPutAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters), serviceCallback); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionResourceInner object + */ + public Observable beginPutAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + return beginPutWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).map(new Func1, PrivateEndpointConnectionResourceInner>() { + @Override + public PrivateEndpointConnectionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters Request body for operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionResourceInner object + */ + public Observable> beginPutWithServiceResponseAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2020-02-02"; + return service.beginPut(vaultName, resourceGroupName, this.client.subscriptionId(), privateEndpointConnectionName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + deleteWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2020-02-02"; + Observable> observable = service.delete(vaultName, resourceGroupName, this.client.subscriptionId(), privateEndpointConnectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + beginDeleteWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Private Endpoint requests. This call is made by Backup Admin. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2020-02-02"; + return service.beginDelete(vaultName, resourceGroupName, this.client.subscriptionId(), privateEndpointConnectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, 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(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerInner.java new file mode 100644 index 0000000000000..a1d56a2be76df --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerInner.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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; + +/** + * Protectable Container Class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableContainerType", defaultImpl = ProtectableContainerInner.class) +@JsonTypeName("ProtectableContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "StorageContainer", value = AzureStorageProtectableContainer.class), + @JsonSubTypes.Type(name = "VMAppContainer", value = AzureVMAppContainerProtectableContainer.class) +}) +public class ProtectableContainerInner { + /** + * Friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Type of backup management for the container. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Status of health of the container. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /** + * Fabric Id of the container such as ARM Id. + */ + @JsonProperty(value = "containerId") + private String containerId; + + /** + * 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 ProtectableContainerInner object itself. + */ + public ProtectableContainerInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get type of backup management for the container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management for the container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectableContainerInner object itself. + */ + public ProtectableContainerInner withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get status of health of the container. + * + * @return the healthStatus value + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set status of health of the container. + * + * @param healthStatus the healthStatus value to set + * @return the ProtectableContainerInner object itself. + */ + public ProtectableContainerInner withHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get fabric Id of the container such as ARM Id. + * + * @return the containerId value + */ + public String containerId() { + return this.containerId; + } + + /** + * Set fabric Id of the container such as ARM Id. + * + * @param containerId the containerId value to set + * @return the ProtectableContainerInner object itself. + */ + public ProtectableContainerInner withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerResourceImpl.java new file mode 100644 index 0000000000000..d4409aac15472 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerResourceImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectableContainerResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.Map; + +class ProtectableContainerResourceImpl extends WrapperImpl implements ProtectableContainerResource { + private final RecoveryServicesManager manager; + + ProtectableContainerResourceImpl(ProtectableContainerResourceInner 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 ProtectableContainerInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerResourceInner.java new file mode 100644 index 0000000000000..42c25f30b085b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainerResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Protectable Container Class. + */ +@SkipParentValidation +public class ProtectableContainerResourceInner extends Resource { + /** + * ProtectableContainerResource properties. + */ + @JsonProperty(value = "properties") + private ProtectableContainerInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get protectableContainerResource properties. + * + * @return the properties value + */ + public ProtectableContainerInner properties() { + return this.properties; + } + + /** + * Set protectableContainerResource properties. + * + * @param properties the properties value to set + * @return the ProtectableContainerResourceInner object itself. + */ + public ProtectableContainerResourceInner withProperties(ProtectableContainerInner 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 ProtectableContainerResourceInner object itself. + */ + public ProtectableContainerResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainersImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainersImpl.java new file mode 100644 index 0000000000000..309ebcfa82101 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainersImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectableContainers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectableContainerResource; + +class ProtectableContainersImpl extends WrapperImpl implements ProtectableContainers { + private final RecoveryServicesManager manager; + + ProtectableContainersImpl(RecoveryServicesManager manager) { + super(manager.inner().protectableContainers()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private ProtectableContainerResourceImpl wrapModel(ProtectableContainerResourceInner inner) { + return new ProtectableContainerResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName, final String fabricName) { + ProtectableContainersInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName, fabricName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ProtectableContainerResource call(ProtectableContainerResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainersInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainersInner.java new file mode 100644 index 0000000000000..62a8072a347eb --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectableContainersInner.java @@ -0,0 +1,439 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 ProtectableContainers. + */ +public class ProtectableContainersInner { + /** The Retrofit service to perform REST calls. */ + private ProtectableContainersService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectableContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectableContainersInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectableContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectableContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectableContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectableContainers list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers") + Observable> list(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @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.v2020_02_02.ProtectableContainers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProtectableContainerResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName, final String fabricName) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, fabricName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, fabricName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectableContainerResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String fabricName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectableContainerResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String fabricName) { + return listSinglePageAsync(vaultName, resourceGroupName, fabricName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectableContainerResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final 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."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @param filter OData filter options. + * @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<ProtectableContainerResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName, final String fabricName, final String filter) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @param filter OData filter options. + * @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 fabricName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectableContainerResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName the String value + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectableContainerResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String fabricName, final String filter) { + return listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + ServiceResponse> * @param vaultName The name of the recovery services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group where the recovery services vault is present. + ServiceResponse> * @param fabricName the String value + ServiceResponse> * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectableContainerResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final String fabricName, final 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."); + } + final String apiVersion = "2016-12-01"; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @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<ProtectableContainerResourceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @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<ProtectableContainerResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + * @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<ProtectableContainerResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the containers that can be registered to Recovery Services Vault. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectableContainerResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemOperationStatusesImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemOperationStatusesImpl.java new file mode 100644 index 0000000000000..1b1ae8117e46a --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemOperationStatusesImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectedItemOperationStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 wrapBackupFabricVaultOperationStatusModel(OperationStatusInner inner) { + return new BackupFabricVaultOperationStatusImpl(inner, manager()); + } + + private Observable getOperationStatusInnerUsingProtectedItemOperationStatusesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String vaultName = IdParsingUtils.getValueFromIdByName(id, "vaults"); + String fabricName = IdParsingUtils.getValueFromIdByName(id, "backupFabrics"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "protectionContainers"); + String protectedItemName = IdParsingUtils.getValueFromIdByName(id, "protectedItems"); + String operationId = IdParsingUtils.getValueFromIdByName(id, "operationsStatus"); + ProtectedItemOperationStatusesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId); + } + + @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) + .flatMap(new Func1>() { + @Override + public Observable call(OperationStatusInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BackupFabricVaultOperationStatus)wrapBackupFabricVaultOperationStatusModel(inner)); + } + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemOperationStatusesInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemOperationStatusesInner.java new file mode 100644 index 0000000000000..f58831218656c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemOperationStatusesInner.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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); + + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @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(); + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @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); + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @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(); + } + }); + } + + /** + * Fetches the status of an operation such as triggering a backup, 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param containerName Container name associated with the backup item. + * @param protectedItemName Backup item name whose details are to be fetched. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemResourceImpl.java new file mode 100644 index 0000000000000..98c9e3f0d02ec --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemResourceImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectedItemResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectedItem; +import java.util.Map; + +class ProtectedItemResourceImpl extends WrapperImpl implements ProtectedItemResource { + private final RecoveryServicesManager manager; + + ProtectedItemResourceImpl(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 ProtectedItem properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemResourceInner.java new file mode 100644 index 0000000000000..f318c8e686928 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectedItemResourceInner.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectedItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for backup items. + */ +@SkipParentValidation +public class ProtectedItemResourceInner extends Resource { + /** + * ProtectedItemResource properties. + */ + @JsonProperty(value = "properties") + private ProtectedItem properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get protectedItemResource properties. + * + * @return the properties value + */ + public ProtectedItem properties() { + return this.properties; + } + + /** + * Set protectedItemResource properties. + * + * @param properties the properties value to set + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withProperties(ProtectedItem 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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl.java new file mode 100644 index 0000000000000..a16f007226071 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionContainerBackupFabricVaultProtectionContainerResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +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; + // set resource ancestor and positional variables + 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerInner.java new file mode 100644 index 0000000000000..34575eab08cee --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerInner.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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; + +/** + * Base class for container with backup items. Containers with specific + * workloads are derived from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "containerType", defaultImpl = ProtectionContainerInner.class) +@JsonTypeName("ProtectionContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureSqlContainer", value = AzureSqlContainer.class), + @JsonSubTypes.Type(name = "StorageContainer", value = AzureStorageContainer.class), + @JsonSubTypes.Type(name = "AzureWorkloadContainer", value = AzureWorkloadContainer.class), + @JsonSubTypes.Type(name = "DPMContainer", value = DpmContainer.class), + @JsonSubTypes.Type(name = "GenericContainer", value = GenericContainer.class), + @JsonSubTypes.Type(name = "IaaSVMContainer", value = IaaSVMContainer.class), + @JsonSubTypes.Type(name = "Windows", value = MabContainer.class) +}) +public class ProtectionContainerInner { + /** + * Friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Type of backup management for the container. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Status of registration of the container with the Recovery Services + * Vault. + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /** + * Status of health of the container. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /** + * 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 type of backup management for the container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management for the container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get status of registration of the container with the Recovery Services Vault. + * + * @return the registrationStatus value + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set status of registration of the container 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 status of health of the container. + * + * @return the healthStatus value + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set status of health of the container. + * + * @param healthStatus the healthStatus value to set + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerOperationResultsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerOperationResultsImpl.java new file mode 100644 index 0000000000000..3824980db4abe --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerOperationResultsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionContainerOperationResults; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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) + .flatMap(new Func1>() { + @Override + public Observable call(ProtectionContainerResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ProtectionContainerBackupFabricVaultProtectionContainerResource)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerOperationResultsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerOperationResultsInner.java new file mode 100644 index 0000000000000..5303d6d0b66d6 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerOperationResultsInner.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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); + + } + + /** + * Fetches 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @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(); + } + + /** + * Fetches 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @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); + } + + /** + * Fetches 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @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(); + } + }); + } + + /** + * Fetches 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Container name whose information should be fetched. + * @param operationId Operation ID which represents the operation whose result needs to be fetched. + * @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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerRefreshOperationResultsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerRefreshOperationResultsImpl.java new file mode 100644 index 0000000000000..adc25083455cf --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerRefreshOperationResultsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerRefreshOperationResultsInner.java new file mode 100644 index 0000000000000..3f4e0bdde118c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerRefreshOperationResultsInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param operationId Operation ID associated with the operation whose result needs to be fetched. + * @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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerResourceInner.java new file mode 100644 index 0000000000000..31efb0bc6d5ca --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainerResourceInner.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for container with backup items. Containers with specific + * workloads are derived from this class. + */ +@SkipParentValidation +public class ProtectionContainerResourceInner extends Resource { + /** + * ProtectionContainerResource properties. + */ + @JsonProperty(value = "properties") + private ProtectionContainerInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get protectionContainerResource properties. + * + * @return the properties value + */ + public ProtectionContainerInner properties() { + return this.properties; + } + + /** + * Set protectionContainerResource properties. + * + * @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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainersImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainersImpl.java new file mode 100644 index 0000000000000..f0b506e57ff75 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainersImpl.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionContainers; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupFabricVaultProtectionContainerResource; + +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; + } + + @Override + public BackupFabricVaultProtectionContainerResourceImpl define(String name) { + return wrapModel(name); + } + + private BackupFabricVaultProtectionContainerResourceImpl wrapModel(ProtectionContainerResourceInner inner) { + return new BackupFabricVaultProtectionContainerResourceImpl(inner, manager()); + } + + private BackupFabricVaultProtectionContainerResourceImpl wrapModel(String name) { + return new BackupFabricVaultProtectionContainerResourceImpl(name, this.manager()); + } + + @Override + public Completable inquireAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + ProtectionContainersInner client = this.inner(); + return client.inquireAsync(vaultName, resourceGroupName, fabricName, containerName).toCompletable(); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + ProtectionContainersInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName) + .flatMap(new Func1>() { + @Override + public Observable call(ProtectionContainerResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BackupFabricVaultProtectionContainerResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable unregisterAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + ProtectionContainersInner client = this.inner(); + return client.unregisterAsync(vaultName, resourceGroupName, fabricName, containerName).toCompletable(); + } + + @Override + public Completable refreshAsync(String vaultName, String resourceGroupName, String fabricName) { + ProtectionContainersInner client = this.inner(); + return client.refreshAsync(vaultName, resourceGroupName, fabricName).toCompletable(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainersInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainersInner.java new file mode 100644 index 0000000000000..c6ee55698e1ad --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionContainersInner.java @@ -0,0 +1,784 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 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.POST; +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 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.v2020_02_02.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.v2020_02_02.ProtectionContainers register" }) + @PUT("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") + Observable> register(@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, @Body ProtectionContainerResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionContainers unregister" }) + @HTTP(path = "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}", method = "DELETE", hasBody = true) + Observable> unregister(@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.v2020_02_02.ProtectionContainers inquire" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire") + Observable> inquire(@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, @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.v2020_02_02.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, @Query("$filter") String filter, @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 where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @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 where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @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 where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @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 where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container whose details need to be fetched. + * @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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, 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); + } + + /** + * Registers the container with Recovery Services vault. + This is an asynchronous operation. To track the operation status, use location header to call get latest status of + the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for 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 register(String vaultName, String resourceGroupName, String fabricName, String containerName, ProtectionContainerResourceInner parameters) { + return registerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).toBlocking().single().body(); + } + + /** + * Registers the container with Recovery Services vault. + This is an asynchronous operation. To track the operation status, use location header to call get latest status of + the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for 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 registerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, ProtectionContainerResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(registerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, parameters), serviceCallback); + } + + /** + * Registers the container with Recovery Services vault. + This is an asynchronous operation. To track the operation status, use location header to call get latest status of + the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionContainerResourceInner object + */ + public Observable registerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, ProtectionContainerResourceInner parameters) { + return registerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).map(new Func1, ProtectionContainerResourceInner>() { + @Override + public ProtectionContainerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Registers the container with Recovery Services vault. + This is an asynchronous operation. To track the operation status, use location header to call get latest status of + the operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the container. + * @param containerName Name of the container to be registered. + * @param parameters Request body for operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionContainerResourceInner object + */ + public Observable> registerWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, ProtectionContainerResourceInner parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2016-12-01"; + return service.register(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = registerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse registerDelegate(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); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To determine + whether the backend service has finished processing the request, call Get Container Operation Result API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from 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 unregister(String vaultName, String resourceGroupName, String fabricName, String containerName) { + unregisterWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).toBlocking().single().body(); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To determine + whether the backend service has finished processing the request, call Get Container Operation Result API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from 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 unregisterAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unregisterWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName), serviceCallback); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To determine + whether the backend service has finished processing the request, call Get Container Operation Result API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable unregisterAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + return unregisterWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To determine + whether the backend service has finished processing the request, call Get Container Operation Result API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Name of the fabric where the container belongs. + * @param containerName Name of the container which needs to be unregistered from the Recovery Services Vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> unregisterWithServiceResponseAsync(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."); + } + final String apiVersion = "2016-12-01"; + return service.unregister(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, 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(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @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 inquire(String vaultName, String resourceGroupName, String fabricName, String containerName) { + inquireWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).toBlocking().single().body(); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @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 inquireAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(inquireWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName), serviceCallback); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable inquireAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + return inquireWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> inquireWithServiceResponseAsync(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."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + return service.inquire(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = inquireDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @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 inquire(String vaultName, String resourceGroupName, String fabricName, String containerName, String filter) { + inquireWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter).toBlocking().single().body(); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @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 inquireAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(inquireWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter), serviceCallback); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable inquireAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String filter) { + return inquireWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Inquires all the protectable items under the given container. + * This is an async operation and the results should be tracked using location header or Azure-async-url. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric Name associated with the container. + * @param containerName Name of the container in which inquiry needs to be triggered. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> inquireWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, 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."); + } + final String apiVersion = "2016-12-01"; + return service.inquire(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, apiVersion, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = inquireDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse inquireDelegate(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); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated 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 all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated 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 all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated 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 all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated 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."); + } + final String apiVersion = "2016-12-01"; + final String filter = null; + return service.refresh(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, apiVersion, filter, 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); + } + } + }); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @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, String filter) { + refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, filter).toBlocking().single().body(); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @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, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, filter), serviceCallback); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable refreshAsync(String vaultName, String resourceGroupName, String fabricName, String filter) { + return refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, filter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated the container. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> refreshWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, 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."); + } + final String apiVersion = "2016-12-01"; + return service.refresh(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, apiVersion, filter, 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); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentInner.java new file mode 100644 index 0000000000000..4da830c6b3fe5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentInner.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupManagementType; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for backup ProtectionIntent. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectionIntentItemType", defaultImpl = ProtectionIntentInner.class) +@JsonTypeName("ProtectionIntent") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "RecoveryServiceVaultItem", value = AzureRecoveryServiceVaultProtectionIntent.class), + @JsonSubTypes.Type(name = "AzureResourceItem", value = AzureResourceProtectionIntent.class) +}) +public class ProtectionIntentInner { + /** + * Type of backup management for the backed up item. Possible values + * include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', + * 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * ARM ID of the resource to be backed up. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * ID of the item which is getting protected, In case of Azure Vm , it is + * ProtectedItemId. + */ + @JsonProperty(value = "itemId") + private String itemId; + + /** + * ID of the backup policy with which this item is backed up. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /** + * Backup state of this backup item. Possible values include: 'Invalid', + * 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + */ + @JsonProperty(value = "protectionState") + private ProtectionStatus protectionState; + + /** + * Get type of backup management for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management for the backed up item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', 'DefaultBackup'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectionIntentInner object itself. + */ + public ProtectionIntentInner withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get aRM ID of the resource to be backed up. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set aRM ID of the resource to be backed up. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the ProtectionIntentInner object itself. + */ + public ProtectionIntentInner withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get iD of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId. + * + * @return the itemId value + */ + public String itemId() { + return this.itemId; + } + + /** + * Set iD of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId. + * + * @param itemId the itemId value to set + * @return the ProtectionIntentInner object itself. + */ + public ProtectionIntentInner withItemId(String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Get iD of the backup policy with which this item is backed up. + * + * @return the policyId value + */ + public String policyId() { + return this.policyId; + } + + /** + * Set iD of the backup policy with which this item is backed up. + * + * @param policyId the policyId value to set + * @return the ProtectionIntentInner object itself. + */ + public ProtectionIntentInner withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get backup state of this backup item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @return the protectionState value + */ + public ProtectionStatus protectionState() { + return this.protectionState; + } + + /** + * Set backup state of this backup item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected', 'ProtectionFailed'. + * + * @param protectionState the protectionState value to set + * @return the ProtectionIntentInner object itself. + */ + public ProtectionIntentInner withProtectionState(ProtectionStatus protectionState) { + this.protectionState = protectionState; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentResourceImpl.java new file mode 100644 index 0000000000000..87e31bbd393fe --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentResourceImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntentResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.Map; + +class ProtectionIntentResourceImpl extends WrapperImpl implements ProtectionIntentResource { + private final RecoveryServicesManager manager; + + ProtectionIntentResourceImpl(ProtectionIntentResourceInner 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 ProtectionIntentInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentResourceInner.java new file mode 100644 index 0000000000000..21d198b82254e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for backup ProtectionIntent. + */ +@SkipParentValidation +public class ProtectionIntentResourceInner extends Resource { + /** + * ProtectionIntentResource properties. + */ + @JsonProperty(value = "properties") + private ProtectionIntentInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get protectionIntentResource properties. + * + * @return the properties value + */ + public ProtectionIntentInner properties() { + return this.properties; + } + + /** + * Set protectionIntentResource properties. + * + * @param properties the properties value to set + * @return the ProtectionIntentResourceInner object itself. + */ + public ProtectionIntentResourceInner withProperties(ProtectionIntentInner 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 ProtectionIntentResourceInner object itself. + */ + public ProtectionIntentResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentsImpl.java new file mode 100644 index 0000000000000..6a418a2d44728 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntents; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PreValidateEnableBackupResponse; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PreValidateEnableBackupRequest; +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntentResource; + +class ProtectionIntentsImpl extends WrapperImpl implements ProtectionIntents { + private final RecoveryServicesManager manager; + + ProtectionIntentsImpl(RecoveryServicesManager manager) { + super(manager.inner().protectionIntents()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable validateAsync(String azureRegion, PreValidateEnableBackupRequest parameters) { + ProtectionIntentsInner client = this.inner(); + return client.validateAsync(azureRegion, parameters) + .map(new Func1() { + @Override + public PreValidateEnableBackupResponse call(PreValidateEnableBackupResponseInner inner) { + return new PreValidateEnableBackupResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + ProtectionIntentsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, intentObjectName) + .map(new Func1() { + @Override + public ProtectionIntentResource call(ProtectionIntentResourceInner inner) { + return new ProtectionIntentResourceImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters) { + ProtectionIntentsInner client = this.inner(); + return client.createOrUpdateAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters) + .map(new Func1() { + @Override + public ProtectionIntentResource call(ProtectionIntentResourceInner inner) { + return new ProtectionIntentResourceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + ProtectionIntentsInner client = this.inner(); + return client.deleteAsync(vaultName, resourceGroupName, fabricName, intentObjectName).toCompletable(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentsInner.java new file mode 100644 index 0000000000000..16f9d99582990 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionIntentsInner.java @@ -0,0 +1,482 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.PreValidateEnableBackupRequest; +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.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 ProtectionIntents. + */ +public class ProtectionIntentsInner { + /** The Retrofit service to perform REST calls. */ + private ProtectionIntentsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionIntentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectionIntentsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectionIntentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectionIntents to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectionIntentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntents validate" }) + @POST("Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection") + Observable> validate(@Path("azureRegion") String azureRegion, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body PreValidateEnableBackupRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntents get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("intentObjectName") String intentObjectName, @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.v2020_02_02.ProtectionIntents createOrUpdate" }) + @PUT("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") + Observable> createOrUpdate(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("intentObjectName") String intentObjectName, @Query("api-version") String apiVersion, @Body ProtectionIntentResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntents delete" }) + @HTTP(path = "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("intentObjectName") String intentObjectName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * It will validate followings + 1. Vault capacity + 2. VM is already protected + 3. Any VM related configuration passed in properties. + * + * @param azureRegion Azure region to hit Api + * @param parameters Enable backup validation request on Virtual Machine + * @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 PreValidateEnableBackupResponseInner object if successful. + */ + public PreValidateEnableBackupResponseInner validate(String azureRegion, PreValidateEnableBackupRequest parameters) { + return validateWithServiceResponseAsync(azureRegion, parameters).toBlocking().single().body(); + } + + /** + * It will validate followings + 1. Vault capacity + 2. VM is already protected + 3. Any VM related configuration passed in properties. + * + * @param azureRegion Azure region to hit Api + * @param parameters Enable backup validation request on Virtual Machine + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validateAsync(String azureRegion, PreValidateEnableBackupRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateWithServiceResponseAsync(azureRegion, parameters), serviceCallback); + } + + /** + * It will validate followings + 1. Vault capacity + 2. VM is already protected + 3. Any VM related configuration passed in properties. + * + * @param azureRegion Azure region to hit Api + * @param parameters Enable backup validation request on Virtual Machine + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PreValidateEnableBackupResponseInner object + */ + public Observable validateAsync(String azureRegion, PreValidateEnableBackupRequest parameters) { + return validateWithServiceResponseAsync(azureRegion, parameters).map(new Func1, PreValidateEnableBackupResponseInner>() { + @Override + public PreValidateEnableBackupResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * It will validate followings + 1. Vault capacity + 2. VM is already protected + 3. Any VM related configuration passed in properties. + * + * @param azureRegion Azure region to hit Api + * @param parameters Enable backup validation request on Virtual Machine + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PreValidateEnableBackupResponseInner object + */ + public Observable> validateWithServiceResponseAsync(String azureRegion, PreValidateEnableBackupRequest parameters) { + if (azureRegion == null) { + throw new IllegalArgumentException("Parameter azureRegion 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01"; + return service.validate(azureRegion, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateDelegate(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); + } + + /** + * Provides the details of the protection intent up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @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 ProtectionIntentResourceInner object if successful. + */ + public ProtectionIntentResourceInner get(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName).toBlocking().single().body(); + } + + /** + * Provides the details of the protection intent up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @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 intentObjectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName), serviceCallback); + } + + /** + * Provides the details of the protection intent up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionIntentResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName).map(new Func1, ProtectionIntentResourceInner>() { + @Override + public ProtectionIntentResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the details of the protection intent up 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 where the recovery services vault is present. + * @param fabricName Fabric name associated with the backed up item. + * @param intentObjectName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionIntentResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { + 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 (intentObjectName == null) { + throw new IllegalArgumentException("Parameter intentObjectName is required and cannot be null."); + } + final String apiVersion = "2017-07-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, intentObjectName, 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); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up 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 + * @return the ProtectionIntentResourceInner object if successful. + */ + public ProtectionIntentResourceInner createOrUpdate(String vaultName, String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters) { + return createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters).toBlocking().single().body(); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up 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 intentObjectName, ProtectionIntentResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters), serviceCallback); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionIntentResourceInner object + */ + public Observable createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters) { + return createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters).map(new Func1, ProtectionIntentResourceInner>() { + @Override + public ProtectionIntentResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Intent for Enabling backup of an item. This is a synchronous operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the backup item. + * @param intentObjectName Intent object name. + * @param parameters resource backed up item + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionIntentResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters) { + 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 (intentObjectName == null) { + throw new IllegalArgumentException("Parameter intentObjectName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-07-01"; + return service.createOrUpdate(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, intentObjectName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent 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 intentObjectName) { + deleteWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName).toBlocking().single().body(); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent 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 intentObjectName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName), serviceCallback); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent 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 intentObjectName) { + return deleteWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Used to remove intent from an item. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param fabricName Fabric name associated with the intent. + * @param intentObjectName Intent 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 intentObjectName) { + 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 (intentObjectName == null) { + throw new IllegalArgumentException("Parameter intentObjectName is required and cannot be null."); + } + final String apiVersion = "2017-07-01"; + return service.delete(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, intentObjectName, 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(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionPolicyOperationStatusesImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionPolicyOperationStatusesImpl.java new file mode 100644 index 0000000000000..e537ce7272874 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionPolicyOperationStatusesImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionPolicyOperationStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 wrapBackupPolicyVaultOperationStatusModel(OperationStatusInner inner) { + return new BackupPolicyVaultOperationStatusImpl(inner, manager()); + } + + private Observable getOperationStatusInnerUsingProtectionPolicyOperationStatusesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String vaultName = IdParsingUtils.getValueFromIdByName(id, "vaults"); + String policyName = IdParsingUtils.getValueFromIdByName(id, "backupPolicies"); + String operationId = IdParsingUtils.getValueFromIdByName(id, "operations"); + ProtectionPolicyOperationStatusesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, policyName, operationId); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String policyName, String operationId) { + ProtectionPolicyOperationStatusesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, policyName, operationId) + .flatMap(new Func1>() { + @Override + public Observable call(OperationStatusInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BackupPolicyVaultOperationStatus)wrapBackupPolicyVaultOperationStatusModel(inner)); + } + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionPolicyOperationStatusesInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionPolicyOperationStatusesInner.java new file mode 100644 index 0000000000000..adee5dfed583c --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ProtectionPolicyOperationStatusesInner.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.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, restore. The status can be in progress, completed + or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some operations + create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @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, restore. The status can be in progress, completed + or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some operations + create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @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, restore. The status can be in progress, completed + or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some operations + create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @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, restore. The status can be in progress, completed + or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some operations + create jobs. This method returns the list of jobs associated with operation. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param policyName Backup policy name whose operation's status needs to be fetched. + * @param operationId Operation ID which represents an operation whose status needs to be fetched. + * @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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), policyName, operationId, 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/RecoveryServicesBackupClientImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/RecoveryServicesBackupClientImpl.java new file mode 100644 index 0000000000000..0e3097337a1b3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/RecoveryServicesBackupClientImpl.java @@ -0,0 +1,709 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ErrorResponseException; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the RecoveryServicesBackupClientImpl class. + */ +public class RecoveryServicesBackupClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private RecoveryServicesBackupClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** 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; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public RecoveryServicesBackupClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public RecoveryServicesBackupClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public RecoveryServicesBackupClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The BackupResourceVaultConfigsInner object to access its operations. + */ + private BackupResourceVaultConfigsInner backupResourceVaultConfigs; + + /** + * Gets the BackupResourceVaultConfigsInner object to access its operations. + * @return the BackupResourceVaultConfigsInner object. + */ + public BackupResourceVaultConfigsInner backupResourceVaultConfigs() { + return this.backupResourceVaultConfigs; + } + + /** + * The BackupJobsInner object to access its operations. + */ + private BackupJobsInner backupJobs; + + /** + * Gets the BackupJobsInner object to access its operations. + * @return the BackupJobsInner object. + */ + public BackupJobsInner backupJobs() { + return this.backupJobs; + } + + /** + * 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 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 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 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 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 BackupProtectedItemsInner object to access its operations. + */ + private BackupProtectedItemsInner backupProtectedItems; + + /** + * Gets the BackupProtectedItemsInner object to access its operations. + * @return the BackupProtectedItemsInner object. + */ + public BackupProtectedItemsInner backupProtectedItems() { + return this.backupProtectedItems; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ProtectionIntentsInner object to access its operations. + */ + private ProtectionIntentsInner protectionIntents; + + /** + * Gets the ProtectionIntentsInner object to access its operations. + * @return the ProtectionIntentsInner object. + */ + public ProtectionIntentsInner protectionIntents() { + return this.protectionIntents; + } + + /** + * The BackupStatusInner object to access its operations. + */ + private BackupStatusInner backupStatus; + + /** + * Gets the BackupStatusInner object to access its operations. + * @return the BackupStatusInner object. + */ + public BackupStatusInner backupStatus() { + return this.backupStatus; + } + + /** + * The FeatureSupportsInner object to access its operations. + */ + private FeatureSupportsInner featureSupports; + + /** + * Gets the FeatureSupportsInner object to access its operations. + * @return the FeatureSupportsInner object. + */ + public FeatureSupportsInner featureSupports() { + return this.featureSupports; + } + + /** + * The BackupProtectionIntentsInner object to access its operations. + */ + private BackupProtectionIntentsInner backupProtectionIntents; + + /** + * Gets the BackupProtectionIntentsInner object to access its operations. + * @return the BackupProtectionIntentsInner object. + */ + public BackupProtectionIntentsInner backupProtectionIntents() { + return this.backupProtectionIntents; + } + + /** + * The BackupUsageSummariesInner object to access its operations. + */ + private BackupUsageSummariesInner backupUsageSummaries; + + /** + * Gets the BackupUsageSummariesInner object to access its operations. + * @return the BackupUsageSummariesInner object. + */ + public BackupUsageSummariesInner backupUsageSummaries() { + return this.backupUsageSummaries; + } + + /** + * 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; + } + + /** + * 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 ProtectableContainersInner object to access its operations. + */ + private ProtectableContainersInner protectableContainers; + + /** + * Gets the ProtectableContainersInner object to access its operations. + * @return the ProtectableContainersInner object. + */ + public ProtectableContainersInner protectableContainers() { + return this.protectableContainers; + } + + /** + * 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 BackupWorkloadItemsInner object to access its operations. + */ + private BackupWorkloadItemsInner backupWorkloadItems; + + /** + * Gets the BackupWorkloadItemsInner object to access its operations. + * @return the BackupWorkloadItemsInner object. + */ + public BackupWorkloadItemsInner backupWorkloadItems() { + return this.backupWorkloadItems; + } + + /** + * 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 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 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 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 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 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 BackupProtectableItemsInner object to access its operations. + */ + private BackupProtectableItemsInner backupProtectableItems; + + /** + * Gets the BackupProtectableItemsInner object to access its operations. + * @return the BackupProtectableItemsInner object. + */ + public BackupProtectableItemsInner backupProtectableItems() { + return this.backupProtectableItems; + } + + /** + * The BackupProtectionContainersInner object to access its operations. + */ + private BackupProtectionContainersInner backupProtectionContainers; + + /** + * Gets the BackupProtectionContainersInner object to access its operations. + * @return the BackupProtectionContainersInner object. + */ + public BackupProtectionContainersInner backupProtectionContainers() { + return this.backupProtectionContainers; + } + + /** + * The SecurityPINsInner object to access its operations. + */ + private SecurityPINsInner securityPINs; + + /** + * Gets the SecurityPINsInner object to access its operations. + * @return the SecurityPINsInner object. + */ + public SecurityPINsInner securityPINs() { + return this.securityPINs; + } + + /** + * 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.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.backupResourceVaultConfigs = new BackupResourceVaultConfigsInner(restClient().retrofit(), this); + this.backupJobs = new BackupJobsInner(restClient().retrofit(), this); + this.jobDetails = new JobDetailsInner(restClient().retrofit(), this); + this.jobCancellations = new JobCancellationsInner(restClient().retrofit(), this); + this.jobOperationResults = new JobOperationResultsInner(restClient().retrofit(), this); + this.exportJobsOperationResults = new ExportJobsOperationResultsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.backupProtectedItems = new BackupProtectedItemsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.protectionIntents = new ProtectionIntentsInner(restClient().retrofit(), this); + this.backupStatus = new BackupStatusInner(restClient().retrofit(), this); + this.featureSupports = new FeatureSupportsInner(restClient().retrofit(), this); + this.backupProtectionIntents = new BackupProtectionIntentsInner(restClient().retrofit(), this); + this.backupUsageSummaries = new BackupUsageSummariesInner(restClient().retrofit(), this); + this.backupEngines = new BackupEnginesInner(restClient().retrofit(), this); + this.protectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsInner(restClient().retrofit(), this); + this.protectableContainers = new ProtectableContainersInner(restClient().retrofit(), this); + this.protectionContainers = new ProtectionContainersInner(restClient().retrofit(), this); + this.backupWorkloadItems = new BackupWorkloadItemsInner(restClient().retrofit(), this); + this.protectionContainerOperationResults = new ProtectionContainerOperationResultsInner(restClient().retrofit(), this); + this.protectedItemOperationStatuses = new ProtectedItemOperationStatusesInner(restClient().retrofit(), this); + this.itemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsInner(restClient().retrofit(), this); + this.backupOperationResults = new BackupOperationResultsInner(restClient().retrofit(), this); + this.backupOperationStatuses = new BackupOperationStatusesInner(restClient().retrofit(), this); + this.protectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesInner(restClient().retrofit(), this); + this.backupProtectableItems = new BackupProtectableItemsInner(restClient().retrofit(), this); + this.backupProtectionContainers = new BackupProtectionContainersInner(restClient().retrofit(), this); + this.securityPINs = new SecurityPINsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "RecoveryServicesBackupClient", "2020-02-02"); + } + + private void initializeService() { + service = restClient().retrofit().create(RecoveryServicesBackupClientService.class); + } + + /** + * The interface defining all the services for RecoveryServicesBackupClient to be + * used by Retrofit to perform actually REST calls. + */ + interface RecoveryServicesBackupClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.RecoveryServicesBackupClient getOperationStatus" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}") + Observable> getOperationStatus(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusInner object if successful. + */ + public OperationStatusInner getOperationStatus(String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId) { + return getOperationStatusWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId).toBlocking().single().body(); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOperationStatusAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOperationStatusWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId), serviceCallback); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable getOperationStatusAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, String operationId) { + return getOperationStatusWithServiceResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId).map(new Func1, OperationStatusInner>() { + @Override + public OperationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the operation status for a private endpoint connection. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param operationId Operation id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable> getOperationStatusWithServiceResponseAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, 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.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + final String apiVersion = "2020-02-02"; + return service.getOperationStatus(vaultName, resourceGroupName, this.subscriptionId(), privateEndpointConnectionName, operationId, apiVersion, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOperationStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOperationStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/RecoveryServicesManager.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/RecoveryServicesManager.java new file mode 100644 index 0000000000000..4e87e603fdd1b --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/RecoveryServicesManager.java @@ -0,0 +1,437 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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.v2020_02_02.PrivateEndpointConnections; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupResourceVaultConfigs; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupJobs; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.JobDetails; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.JobCancellations; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.JobOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ExportJobsOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.Jobs; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectedItems; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.Operations; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionIntents; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupStatus; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.FeatureSupports; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectionIntents; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupUsageSummaries; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupEngines; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionContainerRefreshOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectableContainers; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionContainers; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupWorkloadItems; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionContainerOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectedItemOperationStatuses; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ItemLevelRecoveryConnections; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupOperationStatuses; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ProtectionPolicyOperationStatuses; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectableItems; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.BackupProtectionContainers; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.SecurityPINs; +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 PrivateEndpointConnections privateEndpointConnections; + private BackupResourceVaultConfigs backupResourceVaultConfigs; + private BackupJobs backupJobs; + private JobDetails jobDetails; + private JobCancellations jobCancellations; + private JobOperationResults jobOperationResults; + private ExportJobsOperationResults exportJobsOperationResults; + private Jobs jobs; + private BackupProtectedItems backupProtectedItems; + private Operations operations; + private ProtectionIntents protectionIntents; + private BackupStatus backupStatus; + private FeatureSupports featureSupports; + private BackupProtectionIntents backupProtectionIntents; + private BackupUsageSummaries backupUsageSummaries; + private BackupEngines backupEngines; + private ProtectionContainerRefreshOperationResults protectionContainerRefreshOperationResults; + private ProtectableContainers protectableContainers; + private ProtectionContainers protectionContainers; + private BackupWorkloadItems backupWorkloadItems; + private ProtectionContainerOperationResults protectionContainerOperationResults; + private ProtectedItemOperationStatuses protectedItemOperationStatuses; + private ItemLevelRecoveryConnections itemLevelRecoveryConnections; + private BackupOperationResults backupOperationResults; + private BackupOperationStatuses backupOperationStatuses; + private ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses; + private BackupProtectableItems backupProtectableItems; + private BackupProtectionContainers backupProtectionContainers; + private SecurityPINs securityPINs; + /** + * 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 PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage BackupResourceVaultConfigs. + */ + public BackupResourceVaultConfigs backupResourceVaultConfigs() { + if (this.backupResourceVaultConfigs == null) { + this.backupResourceVaultConfigs = new BackupResourceVaultConfigsImpl(this); + } + return this.backupResourceVaultConfigs; + } + + /** + * @return Entry point to manage BackupJobs. + */ + public BackupJobs backupJobs() { + if (this.backupJobs == null) { + this.backupJobs = new BackupJobsImpl(this); + } + return this.backupJobs; + } + + /** + * @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 JobCancellations. + */ + public JobCancellations jobCancellations() { + if (this.jobCancellations == null) { + this.jobCancellations = new JobCancellationsImpl(this); + } + return this.jobCancellations; + } + + /** + * @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 ExportJobsOperationResults. + */ + public ExportJobsOperationResults exportJobsOperationResults() { + if (this.exportJobsOperationResults == null) { + this.exportJobsOperationResults = new ExportJobsOperationResultsImpl(this); + } + return this.exportJobsOperationResults; + } + + /** + * @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 BackupProtectedItems. + */ + public BackupProtectedItems backupProtectedItems() { + if (this.backupProtectedItems == null) { + this.backupProtectedItems = new BackupProtectedItemsImpl(this); + } + return this.backupProtectedItems; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage ProtectionIntents. + */ + public ProtectionIntents protectionIntents() { + if (this.protectionIntents == null) { + this.protectionIntents = new ProtectionIntentsImpl(this); + } + return this.protectionIntents; + } + + /** + * @return Entry point to manage BackupStatus. + */ + public BackupStatus backupStatus() { + if (this.backupStatus == null) { + this.backupStatus = new BackupStatusImpl(this); + } + return this.backupStatus; + } + + /** + * @return Entry point to manage FeatureSupports. + */ + public FeatureSupports featureSupports() { + if (this.featureSupports == null) { + this.featureSupports = new FeatureSupportsImpl(this); + } + return this.featureSupports; + } + + /** + * @return Entry point to manage BackupProtectionIntents. + */ + public BackupProtectionIntents backupProtectionIntents() { + if (this.backupProtectionIntents == null) { + this.backupProtectionIntents = new BackupProtectionIntentsImpl(this); + } + return this.backupProtectionIntents; + } + + /** + * @return Entry point to manage BackupUsageSummaries. + */ + public BackupUsageSummaries backupUsageSummaries() { + if (this.backupUsageSummaries == null) { + this.backupUsageSummaries = new BackupUsageSummariesImpl(this); + } + return this.backupUsageSummaries; + } + + /** + * @return Entry point to manage BackupEngines. + */ + public BackupEngines backupEngines() { + if (this.backupEngines == null) { + this.backupEngines = new BackupEnginesImpl(this); + } + return this.backupEngines; + } + + /** + * @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 ProtectableContainers. + */ + public ProtectableContainers protectableContainers() { + if (this.protectableContainers == null) { + this.protectableContainers = new ProtectableContainersImpl(this); + } + return this.protectableContainers; + } + + /** + * @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 BackupWorkloadItems. + */ + public BackupWorkloadItems backupWorkloadItems() { + if (this.backupWorkloadItems == null) { + this.backupWorkloadItems = new BackupWorkloadItemsImpl(this); + } + return this.backupWorkloadItems; + } + + /** + * @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 ProtectedItemOperationStatuses. + */ + public ProtectedItemOperationStatuses protectedItemOperationStatuses() { + if (this.protectedItemOperationStatuses == null) { + this.protectedItemOperationStatuses = new ProtectedItemOperationStatusesImpl(this); + } + return this.protectedItemOperationStatuses; + } + + /** + * @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 BackupOperationResults. + */ + public BackupOperationResults backupOperationResults() { + if (this.backupOperationResults == null) { + this.backupOperationResults = new BackupOperationResultsImpl(this); + } + return this.backupOperationResults; + } + + /** + * @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 ProtectionPolicyOperationStatuses. + */ + public ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses() { + if (this.protectionPolicyOperationStatuses == null) { + this.protectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesImpl(this); + } + return this.protectionPolicyOperationStatuses; + } + + /** + * @return Entry point to manage BackupProtectableItems. + */ + public BackupProtectableItems backupProtectableItems() { + if (this.backupProtectableItems == null) { + this.backupProtectableItems = new BackupProtectableItemsImpl(this); + } + return this.backupProtectableItems; + } + + /** + * @return Entry point to manage BackupProtectionContainers. + */ + public BackupProtectionContainers backupProtectionContainers() { + if (this.backupProtectionContainers == null) { + this.backupProtectionContainers = new BackupProtectionContainersImpl(this); + } + return this.backupProtectionContainers; + } + + /** + * @return Entry point to manage SecurityPINs. + */ + public SecurityPINs securityPINs() { + if (this.securityPINs == null) { + this.securityPINs = new SecurityPINsImpl(this); + } + return this.securityPINs; + } + + /** + * 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/SecurityPINsImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/SecurityPINsImpl.java new file mode 100644 index 0000000000000..c90fdc275bc45 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/SecurityPINsImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.SecurityPINs; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.TokenInformation; + +class SecurityPINsImpl extends WrapperImpl implements SecurityPINs { + private final RecoveryServicesManager manager; + + SecurityPINsImpl(RecoveryServicesManager manager) { + super(manager.inner().securityPINs()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName) { + SecurityPINsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName) + .map(new Func1() { + @Override + public TokenInformation call(TokenInformationInner inner) { + return new TokenInformationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/SecurityPINsInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/SecurityPINsInner.java new file mode 100644 index 0000000000000..1b4b3407b1995 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/SecurityPINsInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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 SecurityPINs. + */ +public class SecurityPINsInner { + /** The Retrofit service to perform REST calls. */ + private SecurityPINsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of SecurityPINsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecurityPINsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(SecurityPINsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SecurityPINs to be + * used by Retrofit to perform actually REST calls. + */ + interface SecurityPINsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.SecurityPINs get" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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 TokenInformationInner object if successful. + */ + public TokenInformationInner get(String vaultName, String resourceGroupName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName), serviceCallback); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInformationInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1, TokenInformationInner>() { + @Override + public TokenInformationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the security PIN. + * + * @param vaultName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is present. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInformationInner object + */ + public Observable> getWithServiceResponseAsync(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."); + } + final String apiVersion = "2016-12-01"; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/TokenInformationImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/TokenInformationImpl.java new file mode 100644 index 0000000000000..331c4869bb3ec --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/TokenInformationImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.TokenInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class TokenInformationImpl extends WrapperImpl implements TokenInformation { + private final RecoveryServicesManager manager; + TokenInformationImpl(TokenInformationInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Long expiryTimeInUtcTicks() { + return this.inner().expiryTimeInUtcTicks(); + } + + @Override + public String securityPIN() { + return this.inner().securityPIN(); + } + + @Override + public String token() { + return this.inner().token(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/TokenInformationInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/TokenInformationInner.java new file mode 100644 index 0000000000000..080c83918dc26 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/TokenInformationInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The token information details. + */ +public class TokenInformationInner { + /** + * Token value. + */ + @JsonProperty(value = "token") + private String token; + + /** + * Expiry time of token. + */ + @JsonProperty(value = "expiryTimeInUtcTicks") + private Long expiryTimeInUtcTicks; + + /** + * Security PIN. + */ + @JsonProperty(value = "securityPIN") + private String securityPIN; + + /** + * Get token value. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set token value. + * + * @param token the token value to set + * @return the TokenInformationInner object itself. + */ + public TokenInformationInner withToken(String token) { + this.token = token; + return this; + } + + /** + * Get expiry time of token. + * + * @return the expiryTimeInUtcTicks value + */ + public Long expiryTimeInUtcTicks() { + return this.expiryTimeInUtcTicks; + } + + /** + * Set expiry time of token. + * + * @param expiryTimeInUtcTicks the expiryTimeInUtcTicks value to set + * @return the TokenInformationInner object itself. + */ + public TokenInformationInner withExpiryTimeInUtcTicks(Long expiryTimeInUtcTicks) { + this.expiryTimeInUtcTicks = expiryTimeInUtcTicks; + return this; + } + + /** + * Get security PIN. + * + * @return the securityPIN value + */ + public String securityPIN() { + return this.securityPIN; + } + + /** + * Set security PIN. + * + * @param securityPIN the securityPIN value to set + * @return the TokenInformationInner object itself. + */ + public TokenInformationInner withSecurityPIN(String securityPIN) { + this.securityPIN = securityPIN; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ValidateOperationsResponseImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ValidateOperationsResponseImpl.java new file mode 100644 index 0000000000000..aafca2e449ea5 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ValidateOperationsResponseImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidateOperationsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidateOperationResponse; + +class ValidateOperationsResponseImpl extends WrapperImpl implements ValidateOperationsResponse { + private final RecoveryServicesManager manager; + ValidateOperationsResponseImpl(ValidateOperationsResponseInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public ValidateOperationResponse validateOperationResponse() { + return this.inner().validateOperationResponse(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ValidateOperationsResponseInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ValidateOperationsResponseInner.java new file mode 100644 index 0000000000000..7e61bbdcc0ba7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/ValidateOperationsResponseInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.ValidateOperationResponse; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ValidateOperationsResponseInner model. + */ +public class ValidateOperationsResponseInner { + /** + * The validateOperationResponse property. + */ + @JsonProperty(value = "validateOperationResponse") + private ValidateOperationResponse validateOperationResponse; + + /** + * Get the validateOperationResponse value. + * + * @return the validateOperationResponse value + */ + public ValidateOperationResponse validateOperationResponse() { + return this.validateOperationResponse; + } + + /** + * Set the validateOperationResponse value. + * + * @param validateOperationResponse the validateOperationResponse value to set + * @return the ValidateOperationsResponseInner object itself. + */ + public ValidateOperationsResponseInner withValidateOperationResponse(ValidateOperationResponse validateOperationResponse) { + this.validateOperationResponse = validateOperationResponse; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultJobResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultJobResourceImpl.java new file mode 100644 index 0000000000000..f2afdf71084fe --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultJobResourceImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.VaultJobResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultJobResourceModelImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultJobResourceModelImpl.java new file mode 100644 index 0000000000000..5e83fde4014ad --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.VaultJobResourceModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +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; + // set resource ancestor and positional variables + 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultOperationStatusImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultOperationStatusImpl.java new file mode 100644 index 0000000000000..458101f9eade3 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultOperationStatusImpl.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.VaultOperationStatus; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.OperationStatusExtendedInfo; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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; + // set resource ancestor and positional variables + 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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultProtectionContainerResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultProtectionContainerResourceImpl.java new file mode 100644 index 0000000000000..2b21ee7475c70 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/VaultProtectionContainerResourceImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.VaultProtectionContainerResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.Map; + +class VaultProtectionContainerResourceImpl extends WrapperImpl implements VaultProtectionContainerResource { + private final RecoveryServicesManager manager; + + VaultProtectionContainerResourceImpl(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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadItemResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadItemResourceImpl.java new file mode 100644 index 0000000000000..b8242e68d42b4 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadItemResourceImpl.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.WorkloadItemResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.WorkloadItem; +import java.util.Map; + +class WorkloadItemResourceImpl extends WrapperImpl implements WorkloadItemResource { + private final RecoveryServicesManager manager; + + WorkloadItemResourceImpl(WorkloadItemResourceInner 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 WorkloadItem properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadItemResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadItemResourceInner.java new file mode 100644 index 0000000000000..a61eccbffecd0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadItemResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.WorkloadItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for backup item. Workload-specific backup items are derived from + * this class. + */ +@SkipParentValidation +public class WorkloadItemResourceInner extends Resource { + /** + * WorkloadItemResource properties. + */ + @JsonProperty(value = "properties") + private WorkloadItem properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get workloadItemResource properties. + * + * @return the properties value + */ + public WorkloadItem properties() { + return this.properties; + } + + /** + * Set workloadItemResource properties. + * + * @param properties the properties value to set + * @return the WorkloadItemResourceInner object itself. + */ + public WorkloadItemResourceInner withProperties(WorkloadItem 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 WorkloadItemResourceInner object itself. + */ + public WorkloadItemResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadProtectableItemResourceImpl.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadProtectableItemResourceImpl.java new file mode 100644 index 0000000000000..667908f183f20 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.WorkloadProtectableItemResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.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/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadProtectableItemResourceInner.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadProtectableItemResourceInner.java new file mode 100644 index 0000000000000..778e2bf679cb0 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/WorkloadProtectableItemResourceInner.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 1.0.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2020_02_02.WorkloadProtectableItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for backup item. Workload-specific backup items are derived from + * this class. + */ +@SkipParentValidation +public class WorkloadProtectableItemResourceInner extends Resource { + /** + * WorkloadProtectableItemResource properties. + */ + @JsonProperty(value = "properties") + private WorkloadProtectableItem properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get workloadProtectableItemResource properties. + * + * @return the properties value + */ + public WorkloadProtectableItem properties() { + return this.properties; + } + + /** + * Set workloadProtectableItemResource properties. + * + * @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; + } + +} diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/package-info.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/implementation/package-info.java new file mode 100644 index 0000000000000..b8017ef3985a7 --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.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.v2020_02_02.implementation; diff --git a/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/package-info.java b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/package-info.java new file mode 100644 index 0000000000000..eeac03dc8ce0e --- /dev/null +++ b/sdk/recoveryservices.backup/mgmt-v2020_02_02/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2020_02_02/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 1.0.0.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.v2020_02_02;