From c1edede8517c1f2ee5a1a90b0a414635f2fc24d2 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 23 Oct 2020 13:01:59 +0000 Subject: [PATCH] Generated from fbd58fbdd930adca3cac5a222cb2e87b7ef01cfc --- sdk/netapp/mgmt-v2020_07_01/pom.xml | 135 + .../netapp/v2020_07_01/AccountBackups.java | 55 + .../netapp/v2020_07_01/Accounts.java | 24 + .../netapp/v2020_07_01/ActiveDirectory.java | 371 ++ .../v2020_07_01/ActiveDirectoryStatus.java | 50 + .../netapp/v2020_07_01/AuthorizeRequest.java | 43 + .../netapp/v2020_07_01/BackupPatch.java | 150 + .../netapp/v2020_07_01/BackupPolicies.java | 56 + .../netapp/v2020_07_01/BackupPolicy.java | 349 ++ .../v2020_07_01/BackupPolicyDetails.java | 233 ++ .../netapp/v2020_07_01/BackupPolicyPatch.java | 258 ++ .../netapp/v2020_07_01/Backups.java | 62 + .../netapp/v2020_07_01/BackupsList.java | 27 + .../v2020_07_01/BreakReplicationRequest.java | 44 + .../netapp/v2020_07_01/CapacityPool.java | 230 ++ .../CapacityPoolNetAppAccountBackup.java | 175 + .../netapp/v2020_07_01/CapacityPoolPatch.java | 75 + .../CheckAvailabilityResponse.java | 35 + .../v2020_07_01/CheckNameResourceTypes.java | 47 + .../CheckQuotaNameResourceTypes.java | 47 + .../netapp/v2020_07_01/DailySchedule.java | 121 + .../netapp/v2020_07_01/Dimension.java | 69 + .../netapp/v2020_07_01/EndpointType.java | 41 + .../netapp/v2020_07_01/ExportPolicyRule.java | 388 +++ .../netapp/v2020_07_01/HourlySchedule.java | 95 + .../v2020_07_01/InAvailabilityReasonType.java | 41 + .../v2020_07_01/MetricSpecification.java | 252 ++ .../netapp/v2020_07_01/MirrorState.java | 44 + .../netapp/v2020_07_01/MonthlySchedule.java | 148 + .../netapp/v2020_07_01/MountTarget.java | 203 ++ .../v2020_07_01/MountTargetProperties.java | 103 + .../netapp/v2020_07_01/NetAppAccount.java | 103 + .../v2020_07_01/NetAppAccountBackup.java | 73 + .../v2020_07_01/NetAppAccountPatch.java | 62 + .../netapp/v2020_07_01/NetAppResources.java | 58 + .../netapp/v2020_07_01/Operation.java | 40 + .../netapp/v2020_07_01/OperationDisplay.java | 121 + .../netapp/v2020_07_01/Operations.java | 28 + .../netapp/v2020_07_01/PoolChangeRequest.java | 43 + .../management/netapp/v2020_07_01/Pools.java | 56 + .../netapp/v2020_07_01/QosType.java | 41 + .../v2020_07_01/QuotaAvailabilityRequest.java | 99 + .../v2020_07_01/RelationshipStatus.java | 41 + .../netapp/v2020_07_01/ReplicationObject.java | 148 + .../v2020_07_01/ReplicationSchedule.java | 44 + .../netapp/v2020_07_01/ReplicationStatus.java | 45 + .../ResourceNameAvailabilityRequest.java | 99 + .../netapp/v2020_07_01/SecurityStyle.java | 41 + .../netapp/v2020_07_01/ServiceLevel.java | 44 + .../v2020_07_01/ServiceSpecification.java | 44 + .../netapp/v2020_07_01/Snapshot.java | 135 + .../netapp/v2020_07_01/SnapshotPolicies.java | 65 + .../netapp/v2020_07_01/SnapshotPolicy.java | 302 ++ .../v2020_07_01/SnapshotPolicyDetails.java | 281 ++ .../v2020_07_01/SnapshotPolicyPatch.java | 281 ++ .../v2020_07_01/SnapshotPolicyVolumeList.java | 27 + .../netapp/v2020_07_01/Snapshots.java | 62 + .../management/netapp/v2020_07_01/Vault.java | 45 + .../management/netapp/v2020_07_01/Vaults.java | 30 + .../management/netapp/v2020_07_01/Volume.java | 484 +++ .../v2020_07_01/VolumeBackupProperties.java | 121 + .../netapp/v2020_07_01/VolumeBackups.java | 95 + .../netapp/v2020_07_01/VolumePatch.java | 159 + .../VolumePatchPropertiesDataProtection.java | 46 + .../VolumePatchPropertiesExportPolicy.java | 46 + .../VolumePropertiesDataProtection.java | 100 + .../VolumePropertiesExportPolicy.java | 46 + .../netapp/v2020_07_01/VolumeRevert.java | 43 + .../v2020_07_01/VolumeSnapshotProperties.java | 43 + .../netapp/v2020_07_01/Volumes.java | 164 + .../netapp/v2020_07_01/WeeklySchedule.java | 149 + .../implementation/AccountBackupsImpl.java | 70 + .../implementation/AccountBackupsInner.java | 437 +++ .../implementation/AccountsImpl.java | 114 + .../implementation/AccountsInner.java | 805 +++++ .../AzureNetAppFilesManagementClientImpl.java | 336 ++ .../implementation/BackupInner.java | 150 + .../implementation/BackupPoliciesImpl.java | 85 + .../implementation/BackupPoliciesInner.java | 760 +++++ .../implementation/BackupPolicyImpl.java | 260 ++ .../implementation/BackupPolicyInner.java | 234 ++ .../implementation/BackupsImpl.java | 85 + .../implementation/BackupsInner.java | 960 ++++++ .../implementation/BackupsListImpl.java | 32 + .../implementation/BackupsListInner.java | 44 + .../implementation/CapacityPoolImpl.java | 208 ++ .../implementation/CapacityPoolInner.java | 166 + .../CapacityPoolNetAppAccountBackupImpl.java | 181 + .../CheckAvailabilityResponseImpl.java | 42 + .../CheckAvailabilityResponseInner.java | 106 + .../implementation/IdParsingUtils.java | 57 + .../NetAppAccountBackupImpl.java | 94 + .../implementation/NetAppAccountImpl.java | 89 + .../implementation/NetAppAccountInner.java | 63 + .../implementation/NetAppManager.java | 219 ++ .../implementation/NetAppResourcesImpl.java | 68 + .../implementation/NetAppResourcesInner.java | 397 +++ .../implementation/OperationImpl.java | 48 + .../implementation/OperationInner.java | 125 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 138 + .../v2020_07_01/implementation/PageImpl.java | 75 + .../v2020_07_01/implementation/PoolsImpl.java | 85 + .../implementation/PoolsInner.java | 852 +++++ .../implementation/ReplicationStatusImpl.java | 53 + .../ReplicationStatusInner.java | 151 + .../implementation/SnapshotImpl.java | 135 + .../implementation/SnapshotInner.java | 94 + .../implementation/SnapshotPoliciesImpl.java | 98 + .../implementation/SnapshotPoliciesInner.java | 726 ++++ .../implementation/SnapshotPolicyImpl.java | 236 ++ .../implementation/SnapshotPolicyInner.java | 188 + .../SnapshotPolicyVolumeListImpl.java | 32 + .../SnapshotPolicyVolumeListInner.java | 44 + .../implementation/SnapshotsImpl.java | 85 + .../implementation/SnapshotsInner.java | 962 ++++++ .../v2020_07_01/implementation/VaultImpl.java | 55 + .../implementation/VaultInner.java | 72 + .../implementation/VaultsImpl.java | 53 + .../implementation/VaultsInner.java | 156 + .../implementation/VolumeImpl.java | 371 ++ .../implementation/VolumeInner.java | 507 +++ .../implementation/VolumesImpl.java | 140 + .../implementation/VolumesInner.java | 3028 +++++++++++++++++ .../implementation/package-info.java | 11 + .../netapp/v2020_07_01/package-info.java | 11 + 126 files changed, 22567 insertions(+) create mode 100644 sdk/netapp/mgmt-v2020_07_01/pom.xml create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AccountBackups.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Accounts.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectory.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectoryStatus.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AuthorizeRequest.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPatch.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicies.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicy.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyDetails.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyPatch.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Backups.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupsList.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BreakReplicationRequest.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPool.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolNetAppAccountBackup.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolPatch.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckAvailabilityResponse.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckNameResourceTypes.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckQuotaNameResourceTypes.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/DailySchedule.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Dimension.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/EndpointType.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ExportPolicyRule.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/HourlySchedule.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/InAvailabilityReasonType.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MetricSpecification.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MirrorState.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MonthlySchedule.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTarget.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTargetProperties.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccount.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountBackup.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountPatch.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppResources.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operation.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/OperationDisplay.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operations.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/PoolChangeRequest.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Pools.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QosType.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QuotaAvailabilityRequest.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/RelationshipStatus.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationObject.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationSchedule.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationStatus.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ResourceNameAvailabilityRequest.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SecurityStyle.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceLevel.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceSpecification.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshot.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicies.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicy.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyDetails.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyPatch.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyVolumeList.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshots.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vault.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vaults.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volume.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackupProperties.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackups.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatch.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesDataProtection.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesExportPolicy.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesDataProtection.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesExportPolicy.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeRevert.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeSnapshotProperties.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volumes.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/WeeklySchedule.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AzureNetAppFilesManagementClientImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolNetAppAccountBackupImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/IdParsingUtils.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountBackupImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppManager.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PageImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesImpl.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesInner.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/package-info.java create mode 100644 sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/package-info.java diff --git a/sdk/netapp/mgmt-v2020_07_01/pom.xml b/sdk/netapp/mgmt-v2020_07_01/pom.xml new file mode 100644 index 0000000000000..09e4efe49700b --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.netapp.v2020_07_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-netapp + 1.0.0-beta + jar + Microsoft Azure SDK for NetApp Management + This package contains Microsoft NetApp 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/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AccountBackups.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AccountBackups.java new file mode 100644 index 0000000000000..6dd60f3118f10 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AccountBackups.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.AccountBackupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AccountBackups. + */ +public interface AccountBackups extends HasInner { + /** + * List Backups for a Netapp Account. + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Get Backup for a Netapp Account. + * Get Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String backupName); + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String backupName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Accounts.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Accounts.java new file mode 100644 index 0000000000000..6e5cc6501f327 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Accounts.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.AccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Accounts. + */ +public interface Accounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectory.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectory.java new file mode 100644 index 0000000000000..885db98afdee0 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectory.java @@ -0,0 +1,371 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Active Directory. + */ +public class ActiveDirectory { + /** + * Id of the Active Directory. + */ + @JsonProperty(value = "activeDirectoryId") + private String activeDirectoryId; + + /** + * Username of Active Directory domain administrator. + */ + @JsonProperty(value = "username") + private String username; + + /** + * Plain text password of Active Directory domain administrator, value is + * masked in the response. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Name of the Active Directory domain. + */ + @JsonProperty(value = "domain") + private String domain; + + /** + * Comma separated list of DNS server IP addresses (IPv4 only) for the + * Active Directory domain. + */ + @JsonProperty(value = "dns") + private String dns; + + /** + * Status of the Active Directory. Possible values include: 'Created', + * 'InUse', 'Deleted', 'Error', 'Updating'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ActiveDirectoryStatus status; + + /** + * Any details in regards to the Status of the Active Directory. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * NetBIOS name of the SMB server. This name will be registered as a + * computer account in the AD and used to mount volumes. + */ + @JsonProperty(value = "smbServerName") + private String smbServerName; + + /** + * The Organizational Unit (OU) within the Windows Active Directory. + */ + @JsonProperty(value = "organizationalUnit") + private String organizationalUnit; + + /** + * The Active Directory site the service will limit Domain Controller + * discovery to. + */ + @JsonProperty(value = "site") + private String site; + + /** + * Users to be added to the Built-in Backup Operator active directory + * group. A list of unique usernames without domain specifier. + */ + @JsonProperty(value = "backupOperators") + private List backupOperators; + + /** + * kdc server IP addresses for the active directory machine. This optional + * parameter is used only while creating kerberos volume. + */ + @JsonProperty(value = "kdcIP") + private String kdcIP; + + /** + * Name of the active directory machine. This optional parameter is used + * only while creating kerberos volume. + */ + @JsonProperty(value = "adName") + private String adName; + + /** + * When LDAP over SSL/TLS is enabled, the LDAP client is required to have + * base64 encoded Active Directory Certificate Service's self-signed root + * CA certificate, this optional parameter is used only for dual protocol + * with LDAP user-mapping volumes. + */ + @JsonProperty(value = "serverRootCACertificate") + private String serverRootCACertificate; + + /** + * Get id of the Active Directory. + * + * @return the activeDirectoryId value + */ + public String activeDirectoryId() { + return this.activeDirectoryId; + } + + /** + * Set id of the Active Directory. + * + * @param activeDirectoryId the activeDirectoryId value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withActiveDirectoryId(String activeDirectoryId) { + this.activeDirectoryId = activeDirectoryId; + return this; + } + + /** + * Get username of Active Directory domain administrator. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set username of Active Directory domain administrator. + * + * @param username the username value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get plain text password of Active Directory domain administrator, value is masked in the response. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set plain text password of Active Directory domain administrator, value is masked in the response. + * + * @param password the password value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get name of the Active Directory domain. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set name of the Active Directory domain. + * + * @param domain the domain value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain. + * + * @return the dns value + */ + public String dns() { + return this.dns; + } + + /** + * Set comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain. + * + * @param dns the dns value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withDns(String dns) { + this.dns = dns; + return this; + } + + /** + * Get status of the Active Directory. Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating'. + * + * @return the status value + */ + public ActiveDirectoryStatus status() { + return this.status; + } + + /** + * Get any details in regards to the Status of the Active Directory. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get netBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes. + * + * @return the smbServerName value + */ + public String smbServerName() { + return this.smbServerName; + } + + /** + * Set netBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes. + * + * @param smbServerName the smbServerName value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withSmbServerName(String smbServerName) { + this.smbServerName = smbServerName; + return this; + } + + /** + * Get the Organizational Unit (OU) within the Windows Active Directory. + * + * @return the organizationalUnit value + */ + public String organizationalUnit() { + return this.organizationalUnit; + } + + /** + * Set the Organizational Unit (OU) within the Windows Active Directory. + * + * @param organizationalUnit the organizationalUnit value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withOrganizationalUnit(String organizationalUnit) { + this.organizationalUnit = organizationalUnit; + return this; + } + + /** + * Get the Active Directory site the service will limit Domain Controller discovery to. + * + * @return the site value + */ + public String site() { + return this.site; + } + + /** + * Set the Active Directory site the service will limit Domain Controller discovery to. + * + * @param site the site value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withSite(String site) { + this.site = site; + return this; + } + + /** + * Get users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier. + * + * @return the backupOperators value + */ + public List backupOperators() { + return this.backupOperators; + } + + /** + * Set users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier. + * + * @param backupOperators the backupOperators value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withBackupOperators(List backupOperators) { + this.backupOperators = backupOperators; + return this; + } + + /** + * Get kdc server IP addresses for the active directory machine. This optional parameter is used only while creating kerberos volume. + * + * @return the kdcIP value + */ + public String kdcIP() { + return this.kdcIP; + } + + /** + * Set kdc server IP addresses for the active directory machine. This optional parameter is used only while creating kerberos volume. + * + * @param kdcIP the kdcIP value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withKdcIP(String kdcIP) { + this.kdcIP = kdcIP; + return this; + } + + /** + * Get name of the active directory machine. This optional parameter is used only while creating kerberos volume. + * + * @return the adName value + */ + public String adName() { + return this.adName; + } + + /** + * Set name of the active directory machine. This optional parameter is used only while creating kerberos volume. + * + * @param adName the adName value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withAdName(String adName) { + this.adName = adName; + return this; + } + + /** + * Get when LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes. + * + * @return the serverRootCACertificate value + */ + public String serverRootCACertificate() { + return this.serverRootCACertificate; + } + + /** + * Set when LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes. + * + * @param serverRootCACertificate the serverRootCACertificate value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withServerRootCACertificate(String serverRootCACertificate) { + this.serverRootCACertificate = serverRootCACertificate; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectoryStatus.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectoryStatus.java new file mode 100644 index 0000000000000..6cc9b87b4f4db --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ActiveDirectoryStatus.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ActiveDirectoryStatus. + */ +public final class ActiveDirectoryStatus extends ExpandableStringEnum { + /** Static value Created for ActiveDirectoryStatus. */ + public static final ActiveDirectoryStatus CREATED = fromString("Created"); + + /** Static value InUse for ActiveDirectoryStatus. */ + public static final ActiveDirectoryStatus IN_USE = fromString("InUse"); + + /** Static value Deleted for ActiveDirectoryStatus. */ + public static final ActiveDirectoryStatus DELETED = fromString("Deleted"); + + /** Static value Error for ActiveDirectoryStatus. */ + public static final ActiveDirectoryStatus ERROR = fromString("Error"); + + /** Static value Updating for ActiveDirectoryStatus. */ + public static final ActiveDirectoryStatus UPDATING = fromString("Updating"); + + /** + * Creates or finds a ActiveDirectoryStatus from its string representation. + * @param name a name to look for + * @return the corresponding ActiveDirectoryStatus + */ + @JsonCreator + public static ActiveDirectoryStatus fromString(String name) { + return fromString(name, ActiveDirectoryStatus.class); + } + + /** + * @return known ActiveDirectoryStatus values + */ + public static Collection values() { + return values(ActiveDirectoryStatus.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AuthorizeRequest.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AuthorizeRequest.java new file mode 100644 index 0000000000000..e9b90e20cf73e --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/AuthorizeRequest.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Authorize request. + */ +public class AuthorizeRequest { + /** + * Resource id of the remote volume. + */ + @JsonProperty(value = "remoteVolumeResourceId") + private String remoteVolumeResourceId; + + /** + * Get resource id of the remote volume. + * + * @return the remoteVolumeResourceId value + */ + public String remoteVolumeResourceId() { + return this.remoteVolumeResourceId; + } + + /** + * Set resource id of the remote volume. + * + * @param remoteVolumeResourceId the remoteVolumeResourceId value to set + * @return the AuthorizeRequest object itself. + */ + public AuthorizeRequest withRemoteVolumeResourceId(String remoteVolumeResourceId) { + this.remoteVolumeResourceId = remoteVolumeResourceId; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPatch.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPatch.java new file mode 100644 index 0000000000000..b8dab1e2e7a12 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPatch.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Map; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Backup patch. + */ +@JsonFlatten +public class BackupPatch { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * backupId. + * UUID v4 used to identify the Backup. + */ + @JsonProperty(value = "properties.backupId", access = JsonProperty.Access.WRITE_ONLY) + private String backupId; + + /** + * name. + * The creation date of the backup. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Size of backup. + */ + @JsonProperty(value = "properties.size", access = JsonProperty.Access.WRITE_ONLY) + private Long size; + + /** + * Label for backup. + */ + @JsonProperty(value = "properties.label") + private String label; + + /** + * Type of backup adhoc or scheduled. + */ + @JsonProperty(value = "properties.backupType", access = JsonProperty.Access.WRITE_ONLY) + private String backupType; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the BackupPatch object itself. + */ + public BackupPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get uUID v4 used to identify the Backup. + * + * @return the backupId value + */ + public String backupId() { + return this.backupId; + } + + /** + * Get the creation date of the backup. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get size of backup. + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Get label for backup. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label for backup. + * + * @param label the label value to set + * @return the BackupPatch object itself. + */ + public BackupPatch withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get type of backup adhoc or scheduled. + * + * @return the backupType value + */ + public String backupType() { + return this.backupType; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicies.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicies.java new file mode 100644 index 0000000000000..f7a3922f062ac --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicies.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.BackupPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupPolicies. + */ +public interface BackupPolicies extends SupportsCreating, HasInner { + /** + * Get a backup Policy. + * Get a particular backup Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String backupPolicyName); + + /** + * List backup policies. + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String backupPolicyName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicy.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicy.java new file mode 100644 index 0000000000000..d7eb0848c32e1 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicy.java @@ -0,0 +1,349 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.BackupPolicyInner; +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.netapp.v2020_07_01.implementation.NetAppManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing BackupPolicy. + */ +public interface BackupPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the dailyBackupsToKeep value. + */ + Integer dailyBackupsToKeep(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the monthlyBackupsToKeep value. + */ + Integer monthlyBackupsToKeep(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the name1 value. + */ + String name1(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the volumeBackups value. + */ + List volumeBackups(); + + /** + * @return the volumesAssigned value. + */ + Integer volumesAssigned(); + + /** + * @return the weeklyBackupsToKeep value. + */ + Integer weeklyBackupsToKeep(); + + /** + * @return the yearlyBackupsToKeep value. + */ + Integer yearlyBackupsToKeep(); + + /** + * The entirety of the BackupPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetAppAccount, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of BackupPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BackupPolicy definition. + */ + interface Blank extends WithNetAppAccount { + } + + /** + * The stage of the backuppolicy definition allowing to specify NetAppAccount. + */ + interface WithNetAppAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @return the next definition stage + */ + WithLocation withExistingNetAppAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the backuppolicy definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the location parameter value + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the backuppolicy definition allowing to specify DailyBackupsToKeep. + */ + interface WithDailyBackupsToKeep { + /** + * Specifies dailyBackupsToKeep. + * @param dailyBackupsToKeep Daily backups count to keep + * @return the next definition stage + */ + WithCreate withDailyBackupsToKeep(Integer dailyBackupsToKeep); + } + + /** + * The stage of the backuppolicy definition allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled The property to decide policy is enabled or not + * @return the next definition stage + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the backuppolicy definition allowing to specify MonthlyBackupsToKeep. + */ + interface WithMonthlyBackupsToKeep { + /** + * Specifies monthlyBackupsToKeep. + * @param monthlyBackupsToKeep Monthly backups count to keep + * @return the next definition stage + */ + WithCreate withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep); + } + + /** + * The stage of the backuppolicy definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the backuppolicy definition allowing to specify VolumeBackups. + */ + interface WithVolumeBackups { + /** + * Specifies volumeBackups. + * @param volumeBackups A list of volumes assigned to this policy + * @return the next definition stage + */ + WithCreate withVolumeBackups(List volumeBackups); + } + + /** + * The stage of the backuppolicy definition allowing to specify VolumesAssigned. + */ + interface WithVolumesAssigned { + /** + * Specifies volumesAssigned. + * @param volumesAssigned Volumes using current backup policy + * @return the next definition stage + */ + WithCreate withVolumesAssigned(Integer volumesAssigned); + } + + /** + * The stage of the backuppolicy definition allowing to specify WeeklyBackupsToKeep. + */ + interface WithWeeklyBackupsToKeep { + /** + * Specifies weeklyBackupsToKeep. + * @param weeklyBackupsToKeep Weekly backups count to keep + * @return the next definition stage + */ + WithCreate withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep); + } + + /** + * The stage of the backuppolicy definition allowing to specify YearlyBackupsToKeep. + */ + interface WithYearlyBackupsToKeep { + /** + * Specifies yearlyBackupsToKeep. + * @param yearlyBackupsToKeep Yearly backups count to keep + * @return the next definition stage + */ + WithCreate withYearlyBackupsToKeep(Integer yearlyBackupsToKeep); + } + + /** + * 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.WithDailyBackupsToKeep, DefinitionStages.WithEnabled, DefinitionStages.WithMonthlyBackupsToKeep, DefinitionStages.WithTags, DefinitionStages.WithVolumeBackups, DefinitionStages.WithVolumesAssigned, DefinitionStages.WithWeeklyBackupsToKeep, DefinitionStages.WithYearlyBackupsToKeep { + } + } + /** + * The template for a BackupPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDailyBackupsToKeep, UpdateStages.WithEnabled, UpdateStages.WithLocation, UpdateStages.WithMonthlyBackupsToKeep, UpdateStages.WithVolumeBackups, UpdateStages.WithVolumesAssigned, UpdateStages.WithWeeklyBackupsToKeep, UpdateStages.WithYearlyBackupsToKeep { + } + + /** + * Grouping of BackupPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the backuppolicy update allowing to specify DailyBackupsToKeep. + */ + interface WithDailyBackupsToKeep { + /** + * Specifies dailyBackupsToKeep. + * @param dailyBackupsToKeep Daily backups count to keep + * @return the next update stage + */ + Update withDailyBackupsToKeep(Integer dailyBackupsToKeep); + } + + /** + * The stage of the backuppolicy update allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled The property to decide policy is enabled or not + * @return the next update stage + */ + Update withEnabled(Boolean enabled); + } + + /** + * The stage of the backuppolicy 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 backuppolicy update allowing to specify MonthlyBackupsToKeep. + */ + interface WithMonthlyBackupsToKeep { + /** + * Specifies monthlyBackupsToKeep. + * @param monthlyBackupsToKeep Monthly backups count to keep + * @return the next update stage + */ + Update withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep); + } + + /** + * The stage of the backuppolicy update allowing to specify VolumeBackups. + */ + interface WithVolumeBackups { + /** + * Specifies volumeBackups. + * @param volumeBackups A list of volumes assigned to this policy + * @return the next update stage + */ + Update withVolumeBackups(List volumeBackups); + } + + /** + * The stage of the backuppolicy update allowing to specify VolumesAssigned. + */ + interface WithVolumesAssigned { + /** + * Specifies volumesAssigned. + * @param volumesAssigned Volumes using current backup policy + * @return the next update stage + */ + Update withVolumesAssigned(Integer volumesAssigned); + } + + /** + * The stage of the backuppolicy update allowing to specify WeeklyBackupsToKeep. + */ + interface WithWeeklyBackupsToKeep { + /** + * Specifies weeklyBackupsToKeep. + * @param weeklyBackupsToKeep Weekly backups count to keep + * @return the next update stage + */ + Update withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep); + } + + /** + * The stage of the backuppolicy update allowing to specify YearlyBackupsToKeep. + */ + interface WithYearlyBackupsToKeep { + /** + * Specifies yearlyBackupsToKeep. + * @param yearlyBackupsToKeep Yearly backups count to keep + * @return the next update stage + */ + Update withYearlyBackupsToKeep(Integer yearlyBackupsToKeep); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyDetails.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyDetails.java new file mode 100644 index 0000000000000..ac29cc982e7cf --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyDetails.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Backup policy properties. + */ +@JsonFlatten +public class BackupPolicyDetails extends Resource { + /** + * Name of backup policy. + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String name1; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Daily backups count to keep. + */ + @JsonProperty(value = "properties.dailyBackupsToKeep") + private Integer dailyBackupsToKeep; + + /** + * Weekly backups count to keep. + */ + @JsonProperty(value = "properties.weeklyBackupsToKeep") + private Integer weeklyBackupsToKeep; + + /** + * Monthly backups count to keep. + */ + @JsonProperty(value = "properties.monthlyBackupsToKeep") + private Integer monthlyBackupsToKeep; + + /** + * Yearly backups count to keep. + */ + @JsonProperty(value = "properties.yearlyBackupsToKeep") + private Integer yearlyBackupsToKeep; + + /** + * Volumes using current backup policy. + */ + @JsonProperty(value = "properties.volumesAssigned") + private Integer volumesAssigned; + + /** + * The property to decide policy is enabled or not. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * A list of volumes assigned to this policy. + */ + @JsonProperty(value = "properties.volumeBackups") + private List volumeBackups; + + /** + * Get name of backup policy. + * + * @return the name1 value + */ + public String name1() { + return this.name1; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get daily backups count to keep. + * + * @return the dailyBackupsToKeep value + */ + public Integer dailyBackupsToKeep() { + return this.dailyBackupsToKeep; + } + + /** + * Set daily backups count to keep. + * + * @param dailyBackupsToKeep the dailyBackupsToKeep value to set + * @return the BackupPolicyDetails object itself. + */ + public BackupPolicyDetails withDailyBackupsToKeep(Integer dailyBackupsToKeep) { + this.dailyBackupsToKeep = dailyBackupsToKeep; + return this; + } + + /** + * Get weekly backups count to keep. + * + * @return the weeklyBackupsToKeep value + */ + public Integer weeklyBackupsToKeep() { + return this.weeklyBackupsToKeep; + } + + /** + * Set weekly backups count to keep. + * + * @param weeklyBackupsToKeep the weeklyBackupsToKeep value to set + * @return the BackupPolicyDetails object itself. + */ + public BackupPolicyDetails withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep) { + this.weeklyBackupsToKeep = weeklyBackupsToKeep; + return this; + } + + /** + * Get monthly backups count to keep. + * + * @return the monthlyBackupsToKeep value + */ + public Integer monthlyBackupsToKeep() { + return this.monthlyBackupsToKeep; + } + + /** + * Set monthly backups count to keep. + * + * @param monthlyBackupsToKeep the monthlyBackupsToKeep value to set + * @return the BackupPolicyDetails object itself. + */ + public BackupPolicyDetails withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep) { + this.monthlyBackupsToKeep = monthlyBackupsToKeep; + return this; + } + + /** + * Get yearly backups count to keep. + * + * @return the yearlyBackupsToKeep value + */ + public Integer yearlyBackupsToKeep() { + return this.yearlyBackupsToKeep; + } + + /** + * Set yearly backups count to keep. + * + * @param yearlyBackupsToKeep the yearlyBackupsToKeep value to set + * @return the BackupPolicyDetails object itself. + */ + public BackupPolicyDetails withYearlyBackupsToKeep(Integer yearlyBackupsToKeep) { + this.yearlyBackupsToKeep = yearlyBackupsToKeep; + return this; + } + + /** + * Get volumes using current backup policy. + * + * @return the volumesAssigned value + */ + public Integer volumesAssigned() { + return this.volumesAssigned; + } + + /** + * Set volumes using current backup policy. + * + * @param volumesAssigned the volumesAssigned value to set + * @return the BackupPolicyDetails object itself. + */ + public BackupPolicyDetails withVolumesAssigned(Integer volumesAssigned) { + this.volumesAssigned = volumesAssigned; + return this; + } + + /** + * Get the property to decide policy is enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the property to decide policy is enabled or not. + * + * @param enabled the enabled value to set + * @return the BackupPolicyDetails object itself. + */ + public BackupPolicyDetails withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get a list of volumes assigned to this policy. + * + * @return the volumeBackups value + */ + public List volumeBackups() { + return this.volumeBackups; + } + + /** + * Set a list of volumes assigned to this policy. + * + * @param volumeBackups the volumeBackups value to set + * @return the BackupPolicyDetails object itself. + */ + public BackupPolicyDetails withVolumeBackups(List volumeBackups) { + this.volumeBackups = volumeBackups; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyPatch.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyPatch.java new file mode 100644 index 0000000000000..93e7ad98b29aa --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupPolicyPatch.java @@ -0,0 +1,258 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Backup policy Details for create and update. + */ +@JsonFlatten +public class BackupPolicyPatch { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Name of backup policy. + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Daily backups count to keep. + */ + @JsonProperty(value = "properties.dailyBackupsToKeep") + private Integer dailyBackupsToKeep; + + /** + * Weekly backups count to keep. + */ + @JsonProperty(value = "properties.weeklyBackupsToKeep") + private Integer weeklyBackupsToKeep; + + /** + * Monthly backups count to keep. + */ + @JsonProperty(value = "properties.monthlyBackupsToKeep") + private Integer monthlyBackupsToKeep; + + /** + * Yearly backups count to keep. + */ + @JsonProperty(value = "properties.yearlyBackupsToKeep") + private Integer yearlyBackupsToKeep; + + /** + * Volumes using current backup policy. + */ + @JsonProperty(value = "properties.volumesAssigned") + private Integer volumesAssigned; + + /** + * The property to decide policy is enabled or not. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * A list of volumes assigned to this policy. + */ + @JsonProperty(value = "properties.volumeBackups") + private List volumeBackups; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get name of backup policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get daily backups count to keep. + * + * @return the dailyBackupsToKeep value + */ + public Integer dailyBackupsToKeep() { + return this.dailyBackupsToKeep; + } + + /** + * Set daily backups count to keep. + * + * @param dailyBackupsToKeep the dailyBackupsToKeep value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withDailyBackupsToKeep(Integer dailyBackupsToKeep) { + this.dailyBackupsToKeep = dailyBackupsToKeep; + return this; + } + + /** + * Get weekly backups count to keep. + * + * @return the weeklyBackupsToKeep value + */ + public Integer weeklyBackupsToKeep() { + return this.weeklyBackupsToKeep; + } + + /** + * Set weekly backups count to keep. + * + * @param weeklyBackupsToKeep the weeklyBackupsToKeep value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep) { + this.weeklyBackupsToKeep = weeklyBackupsToKeep; + return this; + } + + /** + * Get monthly backups count to keep. + * + * @return the monthlyBackupsToKeep value + */ + public Integer monthlyBackupsToKeep() { + return this.monthlyBackupsToKeep; + } + + /** + * Set monthly backups count to keep. + * + * @param monthlyBackupsToKeep the monthlyBackupsToKeep value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep) { + this.monthlyBackupsToKeep = monthlyBackupsToKeep; + return this; + } + + /** + * Get yearly backups count to keep. + * + * @return the yearlyBackupsToKeep value + */ + public Integer yearlyBackupsToKeep() { + return this.yearlyBackupsToKeep; + } + + /** + * Set yearly backups count to keep. + * + * @param yearlyBackupsToKeep the yearlyBackupsToKeep value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withYearlyBackupsToKeep(Integer yearlyBackupsToKeep) { + this.yearlyBackupsToKeep = yearlyBackupsToKeep; + return this; + } + + /** + * Get volumes using current backup policy. + * + * @return the volumesAssigned value + */ + public Integer volumesAssigned() { + return this.volumesAssigned; + } + + /** + * Set volumes using current backup policy. + * + * @param volumesAssigned the volumesAssigned value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withVolumesAssigned(Integer volumesAssigned) { + this.volumesAssigned = volumesAssigned; + return this; + } + + /** + * Get the property to decide policy is enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the property to decide policy is enabled or not. + * + * @param enabled the enabled value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get a list of volumes assigned to this policy. + * + * @return the volumeBackups value + */ + public List volumeBackups() { + return this.volumeBackups; + } + + /** + * Set a list of volumes assigned to this policy. + * + * @param volumeBackups the volumeBackups value to set + * @return the BackupPolicyPatch object itself. + */ + public BackupPolicyPatch withVolumeBackups(List volumeBackups) { + this.volumeBackups = volumeBackups; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Backups.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Backups.java new file mode 100644 index 0000000000000..d9f1e93c30bd6 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Backups.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.BackupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Backups. + */ +public interface Backups extends SupportsCreating, HasInner { + /** + * Get a backup. + * Get a particular backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + + /** + * List Backups. + * List all backups for a volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupsList.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupsList.java new file mode 100644 index 0000000000000..f43bb82842fc2 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BackupsList.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.BackupsListInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.BackupInner; +import java.util.List; + +/** + * Type representing BackupsList. + */ +public interface BackupsList extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BreakReplicationRequest.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BreakReplicationRequest.java new file mode 100644 index 0000000000000..e6b545e107935 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/BreakReplicationRequest.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Break replication request. + */ +public class BreakReplicationRequest { + /** + * If replication is in status transferring and you want to force break the + * replication, set to true. + */ + @JsonProperty(value = "forceBreakReplication") + private Boolean forceBreakReplication; + + /** + * Get if replication is in status transferring and you want to force break the replication, set to true. + * + * @return the forceBreakReplication value + */ + public Boolean forceBreakReplication() { + return this.forceBreakReplication; + } + + /** + * Set if replication is in status transferring and you want to force break the replication, set to true. + * + * @param forceBreakReplication the forceBreakReplication value to set + * @return the BreakReplicationRequest object itself. + */ + public BreakReplicationRequest withForceBreakReplication(Boolean forceBreakReplication) { + this.forceBreakReplication = forceBreakReplication; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPool.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPool.java new file mode 100644 index 0000000000000..1e21376647953 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPool.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.CapacityPoolInner; +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.netapp.v2020_07_01.implementation.NetAppManager; +import java.util.Map; + +/** + * Type representing CapacityPool. + */ +public interface CapacityPool extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the poolId value. + */ + String poolId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the qosType value. + */ + QosType qosType(); + + /** + * @return the serviceLevel value. + */ + ServiceLevel serviceLevel(); + + /** + * @return the size value. + */ + long size(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the totalThroughputMibps value. + */ + Double totalThroughputMibps(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the utilizedThroughputMibps value. + */ + Double utilizedThroughputMibps(); + + /** + * The entirety of the CapacityPool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetAppAccount, DefinitionStages.WithLocation, DefinitionStages.WithServiceLevel, DefinitionStages.WithSize, DefinitionStages.WithCreate { + } + + /** + * Grouping of CapacityPool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CapacityPool definition. + */ + interface Blank extends WithNetAppAccount { + } + + /** + * The stage of the capacitypool definition allowing to specify NetAppAccount. + */ + interface WithNetAppAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @return the next definition stage + */ + WithLocation withExistingNetAppAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the capacitypool definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the location parameter value + * @return the next definition stage + */ + WithServiceLevel withLocation(String location); + } + + /** + * The stage of the capacitypool definition allowing to specify ServiceLevel. + */ + interface WithServiceLevel { + /** + * Specifies serviceLevel. + * @param serviceLevel The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + * @return the next definition stage + */ + WithSize withServiceLevel(ServiceLevel serviceLevel); + } + + /** + * The stage of the capacitypool definition allowing to specify Size. + */ + interface WithSize { + /** + * Specifies size. + * @param size Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104) + * @return the next definition stage + */ + WithCreate withSize(long size); + } + + /** + * The stage of the capacitypool definition allowing to specify QosType. + */ + interface WithQosType { + /** + * Specifies qosType. + * @param qosType The qos type of the pool. Possible values include: 'Auto', 'Manual' + * @return the next definition stage + */ + WithCreate withQosType(QosType qosType); + } + + /** + * The stage of the capacitypool definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @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.WithQosType, DefinitionStages.WithTags { + } + } + /** + * The template for a CapacityPool update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithQosType, UpdateStages.WithSize, UpdateStages.WithTags { + } + + /** + * Grouping of CapacityPool update stages. + */ + interface UpdateStages { + /** + * The stage of the capacitypool update allowing to specify QosType. + */ + interface WithQosType { + /** + * Specifies qosType. + * @param qosType The qos type of the pool. Possible values include: 'Auto', 'Manual' + * @return the next update stage + */ + Update withQosType(QosType qosType); + } + + /** + * The stage of the capacitypool update allowing to specify Size. + */ + interface WithSize { + /** + * Specifies size. + * @param size Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104) + * @return the next update stage + */ + Update withSize(Long size); + } + + /** + * The stage of the capacitypool update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolNetAppAccountBackup.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolNetAppAccountBackup.java new file mode 100644 index 0000000000000..86b5df7cabe69 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolNetAppAccountBackup.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.BackupInner; +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.netapp.v2020_07_01.implementation.NetAppManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing CapacityPoolNetAppAccountBackup. + */ +public interface CapacityPoolNetAppAccountBackup extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the backupId value. + */ + String backupId(); + + /** + * @return the backupType value. + */ + String backupType(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the label value. + */ + String label(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the size value. + */ + Long size(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CapacityPoolNetAppAccountBackup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVolume, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of CapacityPoolNetAppAccountBackup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CapacityPoolNetAppAccountBackup definition. + */ + interface Blank extends WithVolume { + } + + /** + * The stage of the capacitypoolnetappaccountbackup definition allowing to specify Volume. + */ + interface WithVolume { + /** + * Specifies resourceGroupName, accountName, poolName, volumeName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @return the next definition stage + */ + WithLocation withExistingVolume(String resourceGroupName, String accountName, String poolName, String volumeName); + } + + /** + * The stage of the capacitypoolnetappaccountbackup 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 capacitypoolnetappaccountbackup definition allowing to specify Label. + */ + interface WithLabel { + /** + * Specifies label. + * @param label Label for backup + * @return the next definition stage + */ + WithCreate withLabel(String label); + } + + /** + * 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.WithLabel { + } + } + /** + * The template for a CapacityPoolNetAppAccountBackup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLabel, UpdateStages.WithTags { + } + + /** + * Grouping of CapacityPoolNetAppAccountBackup update stages. + */ + interface UpdateStages { + /** + * The stage of the capacitypoolnetappaccountbackup update allowing to specify Label. + */ + interface WithLabel { + /** + * Specifies label. + * @param label Label for backup + * @return the next update stage + */ + Update withLabel(String label); + } + + /** + * The stage of the capacitypoolnetappaccountbackup 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/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolPatch.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolPatch.java new file mode 100644 index 0000000000000..71c659278ab76 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CapacityPoolPatch.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Capacity pool patch resource. + */ +@JsonFlatten +public class CapacityPoolPatch extends Resource { + /** + * size. + * Provisioned size of the pool (in bytes). Allowed values are in 4TiB + * chunks (value must be multiply of 4398046511104). + */ + @JsonProperty(value = "properties.size") + private Long size; + + /** + * qosType. + * The qos type of the pool. Possible values include: 'Auto', 'Manual'. + */ + @JsonProperty(value = "properties.qosType") + private QosType qosType; + + /** + * Get provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Set provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @param size the size value to set + * @return the CapacityPoolPatch object itself. + */ + public CapacityPoolPatch withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the qos type of the pool. Possible values include: 'Auto', 'Manual'. + * + * @return the qosType value + */ + public QosType qosType() { + return this.qosType; + } + + /** + * Set the qos type of the pool. Possible values include: 'Auto', 'Manual'. + * + * @param qosType the qosType value to set + * @return the CapacityPoolPatch object itself. + */ + public CapacityPoolPatch withQosType(QosType qosType) { + this.qosType = qosType; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckAvailabilityResponse.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckAvailabilityResponse.java new file mode 100644 index 0000000000000..b58f127b21d4e --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckAvailabilityResponse.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.CheckAvailabilityResponseInner; + +/** + * Type representing CheckAvailabilityResponse. + */ +public interface CheckAvailabilityResponse extends HasInner, HasManager { + /** + * @return the isAvailable value. + */ + Boolean isAvailable(); + + /** + * @return the message value. + */ + String message(); + + /** + * @return the reason value. + */ + InAvailabilityReasonType reason(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckNameResourceTypes.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckNameResourceTypes.java new file mode 100644 index 0000000000000..73465bdfe2ad7 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckNameResourceTypes.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CheckNameResourceTypes. + */ +public final class CheckNameResourceTypes extends ExpandableStringEnum { + /** Static value Microsoft.NetApp/netAppAccounts for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTS = fromString("Microsoft.NetApp/netAppAccounts"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLS = fromString("Microsoft.NetApp/netAppAccounts/capacityPools"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLSVOLUMES = fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLSVOLUMESSNAPSHOTS = fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"); + + /** + * Creates or finds a CheckNameResourceTypes from its string representation. + * @param name a name to look for + * @return the corresponding CheckNameResourceTypes + */ + @JsonCreator + public static CheckNameResourceTypes fromString(String name) { + return fromString(name, CheckNameResourceTypes.class); + } + + /** + * @return known CheckNameResourceTypes values + */ + public static Collection values() { + return values(CheckNameResourceTypes.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckQuotaNameResourceTypes.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckQuotaNameResourceTypes.java new file mode 100644 index 0000000000000..a4bd097a50a07 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/CheckQuotaNameResourceTypes.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CheckQuotaNameResourceTypes. + */ +public final class CheckQuotaNameResourceTypes extends ExpandableStringEnum { + /** Static value Microsoft.NetApp/netAppAccounts for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTS = fromString("Microsoft.NetApp/netAppAccounts"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLS = fromString("Microsoft.NetApp/netAppAccounts/capacityPools"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLSVOLUMES = fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLSVOLUMESSNAPSHOTS = fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"); + + /** + * Creates or finds a CheckQuotaNameResourceTypes from its string representation. + * @param name a name to look for + * @return the corresponding CheckQuotaNameResourceTypes + */ + @JsonCreator + public static CheckQuotaNameResourceTypes fromString(String name) { + return fromString(name, CheckQuotaNameResourceTypes.class); + } + + /** + * @return known CheckQuotaNameResourceTypes values + */ + public static Collection values() { + return values(CheckQuotaNameResourceTypes.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/DailySchedule.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/DailySchedule.java new file mode 100644 index 0000000000000..81bf28672f497 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/DailySchedule.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Daily Schedule properties. + */ +public class DailySchedule { + /** + * Daily snapshot count to keep. + */ + @JsonProperty(value = "snapshotsToKeep") + private Integer snapshotsToKeep; + + /** + * Indicates which hour in UTC timezone a snapshot should be taken. + */ + @JsonProperty(value = "hour") + private Integer hour; + + /** + * Indicates which minute snapshot should be taken. + */ + @JsonProperty(value = "minute") + private Integer minute; + + /** + * Resource size in bytes, current storage usage for the volume in bytes. + */ + @JsonProperty(value = "usedBytes") + private Long usedBytes; + + /** + * Get daily snapshot count to keep. + * + * @return the snapshotsToKeep value + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set daily snapshot count to keep. + * + * @param snapshotsToKeep the snapshotsToKeep value to set + * @return the DailySchedule object itself. + */ + public DailySchedule withSnapshotsToKeep(Integer snapshotsToKeep) { + this.snapshotsToKeep = snapshotsToKeep; + return this; + } + + /** + * Get indicates which hour in UTC timezone a snapshot should be taken. + * + * @return the hour value + */ + public Integer hour() { + return this.hour; + } + + /** + * Set indicates which hour in UTC timezone a snapshot should be taken. + * + * @param hour the hour value to set + * @return the DailySchedule object itself. + */ + public DailySchedule withHour(Integer hour) { + this.hour = hour; + return this; + } + + /** + * Get indicates which minute snapshot should be taken. + * + * @return the minute value + */ + public Integer minute() { + return this.minute; + } + + /** + * Set indicates which minute snapshot should be taken. + * + * @param minute the minute value to set + * @return the DailySchedule object itself. + */ + public DailySchedule withMinute(Integer minute) { + this.minute = minute; + return this; + } + + /** + * Get resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set resource size in bytes, current storage usage for the volume in bytes. + * + * @param usedBytes the usedBytes value to set + * @return the DailySchedule object itself. + */ + public DailySchedule withUsedBytes(Long usedBytes) { + this.usedBytes = usedBytes; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Dimension.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Dimension.java new file mode 100644 index 0000000000000..9b341e34368d7 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Dimension.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of blobs, possibly be blob type or access tier. + */ +public class Dimension { + /** + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get display name of dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set display name of dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/EndpointType.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/EndpointType.java new file mode 100644 index 0000000000000..eee0f3af94f9b --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/EndpointType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointType. + */ +public final class EndpointType extends ExpandableStringEnum { + /** Static value src for EndpointType. */ + public static final EndpointType SRC = fromString("src"); + + /** Static value dst for EndpointType. */ + public static final EndpointType DST = fromString("dst"); + + /** + * Creates or finds a EndpointType from its string representation. + * @param name a name to look for + * @return the corresponding EndpointType + */ + @JsonCreator + public static EndpointType fromString(String name) { + return fromString(name, EndpointType.class); + } + + /** + * @return known EndpointType values + */ + public static Collection values() { + return values(EndpointType.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ExportPolicyRule.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ExportPolicyRule.java new file mode 100644 index 0000000000000..ffab4191c6ed9 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ExportPolicyRule.java @@ -0,0 +1,388 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Volume Export Policy Rule. + */ +public class ExportPolicyRule { + /** + * Order index. + */ + @JsonProperty(value = "ruleIndex") + private Integer ruleIndex; + + /** + * Read only access. + */ + @JsonProperty(value = "unixReadOnly") + private Boolean unixReadOnly; + + /** + * Read and write access. + */ + @JsonProperty(value = "unixReadWrite") + private Boolean unixReadWrite; + + /** + * Kerberos5 Read only access. To be use with swagger version 2020-05-01 or + * later. + */ + @JsonProperty(value = "kerberos5ReadOnly") + private Boolean kerberos5ReadOnly; + + /** + * Kerberos5 Read and write access. To be use with swagger version + * 2020-05-01 or later. + */ + @JsonProperty(value = "kerberos5ReadWrite") + private Boolean kerberos5ReadWrite; + + /** + * Kerberos5i Read only access. To be use with swagger version 2020-05-01 + * or later. + */ + @JsonProperty(value = "kerberos5iReadOnly") + private Boolean kerberos5iReadOnly; + + /** + * Kerberos5i Read and write access. To be use with swagger version + * 2020-05-01 or later. + */ + @JsonProperty(value = "kerberos5iReadWrite") + private Boolean kerberos5iReadWrite; + + /** + * Kerberos5p Read only access. To be use with swagger version 2020-05-01 + * or later. + */ + @JsonProperty(value = "kerberos5pReadOnly") + private Boolean kerberos5pReadOnly; + + /** + * Kerberos5p Read and write access. To be use with swagger version + * 2020-05-01 or later. + */ + @JsonProperty(value = "kerberos5pReadWrite") + private Boolean kerberos5pReadWrite; + + /** + * Allows CIFS protocol. + */ + @JsonProperty(value = "cifs") + private Boolean cifs; + + /** + * Allows NFSv3 protocol. Enable only for NFSv3 type volumes. + */ + @JsonProperty(value = "nfsv3") + private Boolean nfsv3; + + /** + * Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes. + */ + @JsonProperty(value = "nfsv41") + private Boolean nfsv41; + + /** + * Client ingress specification as comma separated string with IPv4 CIDRs, + * IPv4 host addresses and host names. + */ + @JsonProperty(value = "allowedClients") + private String allowedClients; + + /** + * Has root access to volume. + */ + @JsonProperty(value = "hasRootAccess") + private Boolean hasRootAccess; + + /** + * Get order index. + * + * @return the ruleIndex value + */ + public Integer ruleIndex() { + return this.ruleIndex; + } + + /** + * Set order index. + * + * @param ruleIndex the ruleIndex value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withRuleIndex(Integer ruleIndex) { + this.ruleIndex = ruleIndex; + return this; + } + + /** + * Get read only access. + * + * @return the unixReadOnly value + */ + public Boolean unixReadOnly() { + return this.unixReadOnly; + } + + /** + * Set read only access. + * + * @param unixReadOnly the unixReadOnly value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withUnixReadOnly(Boolean unixReadOnly) { + this.unixReadOnly = unixReadOnly; + return this; + } + + /** + * Get read and write access. + * + * @return the unixReadWrite value + */ + public Boolean unixReadWrite() { + return this.unixReadWrite; + } + + /** + * Set read and write access. + * + * @param unixReadWrite the unixReadWrite value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withUnixReadWrite(Boolean unixReadWrite) { + this.unixReadWrite = unixReadWrite; + return this; + } + + /** + * Get kerberos5 Read only access. To be use with swagger version 2020-05-01 or later. + * + * @return the kerberos5ReadOnly value + */ + public Boolean kerberos5ReadOnly() { + return this.kerberos5ReadOnly; + } + + /** + * Set kerberos5 Read only access. To be use with swagger version 2020-05-01 or later. + * + * @param kerberos5ReadOnly the kerberos5ReadOnly value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withKerberos5ReadOnly(Boolean kerberos5ReadOnly) { + this.kerberos5ReadOnly = kerberos5ReadOnly; + return this; + } + + /** + * Get kerberos5 Read and write access. To be use with swagger version 2020-05-01 or later. + * + * @return the kerberos5ReadWrite value + */ + public Boolean kerberos5ReadWrite() { + return this.kerberos5ReadWrite; + } + + /** + * Set kerberos5 Read and write access. To be use with swagger version 2020-05-01 or later. + * + * @param kerberos5ReadWrite the kerberos5ReadWrite value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withKerberos5ReadWrite(Boolean kerberos5ReadWrite) { + this.kerberos5ReadWrite = kerberos5ReadWrite; + return this; + } + + /** + * Get kerberos5i Read only access. To be use with swagger version 2020-05-01 or later. + * + * @return the kerberos5iReadOnly value + */ + public Boolean kerberos5iReadOnly() { + return this.kerberos5iReadOnly; + } + + /** + * Set kerberos5i Read only access. To be use with swagger version 2020-05-01 or later. + * + * @param kerberos5iReadOnly the kerberos5iReadOnly value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withKerberos5iReadOnly(Boolean kerberos5iReadOnly) { + this.kerberos5iReadOnly = kerberos5iReadOnly; + return this; + } + + /** + * Get kerberos5i Read and write access. To be use with swagger version 2020-05-01 or later. + * + * @return the kerberos5iReadWrite value + */ + public Boolean kerberos5iReadWrite() { + return this.kerberos5iReadWrite; + } + + /** + * Set kerberos5i Read and write access. To be use with swagger version 2020-05-01 or later. + * + * @param kerberos5iReadWrite the kerberos5iReadWrite value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withKerberos5iReadWrite(Boolean kerberos5iReadWrite) { + this.kerberos5iReadWrite = kerberos5iReadWrite; + return this; + } + + /** + * Get kerberos5p Read only access. To be use with swagger version 2020-05-01 or later. + * + * @return the kerberos5pReadOnly value + */ + public Boolean kerberos5pReadOnly() { + return this.kerberos5pReadOnly; + } + + /** + * Set kerberos5p Read only access. To be use with swagger version 2020-05-01 or later. + * + * @param kerberos5pReadOnly the kerberos5pReadOnly value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withKerberos5pReadOnly(Boolean kerberos5pReadOnly) { + this.kerberos5pReadOnly = kerberos5pReadOnly; + return this; + } + + /** + * Get kerberos5p Read and write access. To be use with swagger version 2020-05-01 or later. + * + * @return the kerberos5pReadWrite value + */ + public Boolean kerberos5pReadWrite() { + return this.kerberos5pReadWrite; + } + + /** + * Set kerberos5p Read and write access. To be use with swagger version 2020-05-01 or later. + * + * @param kerberos5pReadWrite the kerberos5pReadWrite value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withKerberos5pReadWrite(Boolean kerberos5pReadWrite) { + this.kerberos5pReadWrite = kerberos5pReadWrite; + return this; + } + + /** + * Get allows CIFS protocol. + * + * @return the cifs value + */ + public Boolean cifs() { + return this.cifs; + } + + /** + * Set allows CIFS protocol. + * + * @param cifs the cifs value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withCifs(Boolean cifs) { + this.cifs = cifs; + return this; + } + + /** + * Get allows NFSv3 protocol. Enable only for NFSv3 type volumes. + * + * @return the nfsv3 value + */ + public Boolean nfsv3() { + return this.nfsv3; + } + + /** + * Set allows NFSv3 protocol. Enable only for NFSv3 type volumes. + * + * @param nfsv3 the nfsv3 value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withNfsv3(Boolean nfsv3) { + this.nfsv3 = nfsv3; + return this; + } + + /** + * Get allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes. + * + * @return the nfsv41 value + */ + public Boolean nfsv41() { + return this.nfsv41; + } + + /** + * Set allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes. + * + * @param nfsv41 the nfsv41 value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withNfsv41(Boolean nfsv41) { + this.nfsv41 = nfsv41; + return this; + } + + /** + * Get client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names. + * + * @return the allowedClients value + */ + public String allowedClients() { + return this.allowedClients; + } + + /** + * Set client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names. + * + * @param allowedClients the allowedClients value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withAllowedClients(String allowedClients) { + this.allowedClients = allowedClients; + return this; + } + + /** + * Get has root access to volume. + * + * @return the hasRootAccess value + */ + public Boolean hasRootAccess() { + return this.hasRootAccess; + } + + /** + * Set has root access to volume. + * + * @param hasRootAccess the hasRootAccess value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withHasRootAccess(Boolean hasRootAccess) { + this.hasRootAccess = hasRootAccess; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/HourlySchedule.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/HourlySchedule.java new file mode 100644 index 0000000000000..cfb30070d49ef --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/HourlySchedule.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Hourly Schedule properties. + */ +public class HourlySchedule { + /** + * Hourly snapshot count to keep. + */ + @JsonProperty(value = "snapshotsToKeep") + private Integer snapshotsToKeep; + + /** + * Indicates which minute snapshot should be taken. + */ + @JsonProperty(value = "minute") + private Integer minute; + + /** + * Resource size in bytes, current storage usage for the volume in bytes. + */ + @JsonProperty(value = "usedBytes") + private Long usedBytes; + + /** + * Get hourly snapshot count to keep. + * + * @return the snapshotsToKeep value + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set hourly snapshot count to keep. + * + * @param snapshotsToKeep the snapshotsToKeep value to set + * @return the HourlySchedule object itself. + */ + public HourlySchedule withSnapshotsToKeep(Integer snapshotsToKeep) { + this.snapshotsToKeep = snapshotsToKeep; + return this; + } + + /** + * Get indicates which minute snapshot should be taken. + * + * @return the minute value + */ + public Integer minute() { + return this.minute; + } + + /** + * Set indicates which minute snapshot should be taken. + * + * @param minute the minute value to set + * @return the HourlySchedule object itself. + */ + public HourlySchedule withMinute(Integer minute) { + this.minute = minute; + return this; + } + + /** + * Get resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set resource size in bytes, current storage usage for the volume in bytes. + * + * @param usedBytes the usedBytes value to set + * @return the HourlySchedule object itself. + */ + public HourlySchedule withUsedBytes(Long usedBytes) { + this.usedBytes = usedBytes; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/InAvailabilityReasonType.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/InAvailabilityReasonType.java new file mode 100644 index 0000000000000..6b4d8c5433407 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/InAvailabilityReasonType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InAvailabilityReasonType. + */ +public final class InAvailabilityReasonType extends ExpandableStringEnum { + /** Static value Invalid for InAvailabilityReasonType. */ + public static final InAvailabilityReasonType INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for InAvailabilityReasonType. */ + public static final InAvailabilityReasonType ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a InAvailabilityReasonType from its string representation. + * @param name a name to look for + * @return the corresponding InAvailabilityReasonType + */ + @JsonCreator + public static InAvailabilityReasonType fromString(String name) { + return fromString(name, InAvailabilityReasonType.class); + } + + /** + * @return known InAvailabilityReasonType values + */ + public static Collection values() { + return values(InAvailabilityReasonType.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MetricSpecification.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MetricSpecification.java new file mode 100644 index 0000000000000..afb348ecee967 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MetricSpecification.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric specification of operation. + */ +public class MetricSpecification { + /** + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit could be Bytes or Count. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Dimensions of blobs, including blob type and access tier. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Aggregation type could be Average. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * The property to decide fill gap with zero or not. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * The category this metric specification belong to, could be Capacity. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Account Resource Id. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get name of metric specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of metric specification. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of metric specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of metric specification. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get display description of metric specification. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set display description of metric specification. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit could be Bytes or Count. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit could be Bytes or Count. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of blobs, including blob type and access tier. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get aggregation type could be Average. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set aggregation type could be Average. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the property to decide fill gap with zero or not. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category this metric specification belong to, could be Capacity. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category this metric specification belong to, could be Capacity. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get account Resource Id. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set account Resource Id. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MirrorState.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MirrorState.java new file mode 100644 index 0000000000000..bf72556df13bf --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MirrorState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MirrorState. + */ +public final class MirrorState extends ExpandableStringEnum { + /** Static value Uninitialized for MirrorState. */ + public static final MirrorState UNINITIALIZED = fromString("Uninitialized"); + + /** Static value Mirrored for MirrorState. */ + public static final MirrorState MIRRORED = fromString("Mirrored"); + + /** Static value Broken for MirrorState. */ + public static final MirrorState BROKEN = fromString("Broken"); + + /** + * Creates or finds a MirrorState from its string representation. + * @param name a name to look for + * @return the corresponding MirrorState + */ + @JsonCreator + public static MirrorState fromString(String name) { + return fromString(name, MirrorState.class); + } + + /** + * @return known MirrorState values + */ + public static Collection values() { + return values(MirrorState.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MonthlySchedule.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MonthlySchedule.java new file mode 100644 index 0000000000000..37a63eadd8904 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MonthlySchedule.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Monthly Schedule properties. + */ +public class MonthlySchedule { + /** + * Monthly snapshot count to keep. + */ + @JsonProperty(value = "snapshotsToKeep") + private Integer snapshotsToKeep; + + /** + * Indicates which days of the month snapshot should be taken. A comma + * delimited string. + */ + @JsonProperty(value = "daysOfMonth") + private String daysOfMonth; + + /** + * Indicates which hour in UTC timezone a snapshot should be taken. + */ + @JsonProperty(value = "hour") + private Integer hour; + + /** + * Indicates which minute snapshot should be taken. + */ + @JsonProperty(value = "minute") + private Integer minute; + + /** + * Resource size in bytes, current storage usage for the volume in bytes. + */ + @JsonProperty(value = "usedBytes") + private Long usedBytes; + + /** + * Get monthly snapshot count to keep. + * + * @return the snapshotsToKeep value + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set monthly snapshot count to keep. + * + * @param snapshotsToKeep the snapshotsToKeep value to set + * @return the MonthlySchedule object itself. + */ + public MonthlySchedule withSnapshotsToKeep(Integer snapshotsToKeep) { + this.snapshotsToKeep = snapshotsToKeep; + return this; + } + + /** + * Get indicates which days of the month snapshot should be taken. A comma delimited string. + * + * @return the daysOfMonth value + */ + public String daysOfMonth() { + return this.daysOfMonth; + } + + /** + * Set indicates which days of the month snapshot should be taken. A comma delimited string. + * + * @param daysOfMonth the daysOfMonth value to set + * @return the MonthlySchedule object itself. + */ + public MonthlySchedule withDaysOfMonth(String daysOfMonth) { + this.daysOfMonth = daysOfMonth; + return this; + } + + /** + * Get indicates which hour in UTC timezone a snapshot should be taken. + * + * @return the hour value + */ + public Integer hour() { + return this.hour; + } + + /** + * Set indicates which hour in UTC timezone a snapshot should be taken. + * + * @param hour the hour value to set + * @return the MonthlySchedule object itself. + */ + public MonthlySchedule withHour(Integer hour) { + this.hour = hour; + return this; + } + + /** + * Get indicates which minute snapshot should be taken. + * + * @return the minute value + */ + public Integer minute() { + return this.minute; + } + + /** + * Set indicates which minute snapshot should be taken. + * + * @param minute the minute value to set + * @return the MonthlySchedule object itself. + */ + public MonthlySchedule withMinute(Integer minute) { + this.minute = minute; + return this; + } + + /** + * Get resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set resource size in bytes, current storage usage for the volume in bytes. + * + * @param usedBytes the usedBytes value to set + * @return the MonthlySchedule object itself. + */ + public MonthlySchedule withUsedBytes(Long usedBytes) { + this.usedBytes = usedBytes; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTarget.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTarget.java new file mode 100644 index 0000000000000..4fcc999059d36 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTarget.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Mount Target. + */ +@JsonFlatten +public class MountTarget { + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * mountTargetId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "properties.mountTargetId", access = JsonProperty.Access.WRITE_ONLY) + private String mountTargetId; + + /** + * fileSystemId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "properties.fileSystemId", required = true) + private String fileSystemId; + + /** + * ipAddress. + * The mount target's IPv4 address. + */ + @JsonProperty(value = "properties.ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * smbServerFQDN. + * The SMB server's Fully Qualified Domain Name, FQDN. + */ + @JsonProperty(value = "properties.smbServerFqdn") + private String smbServerFqdn; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the MountTarget object itself. + */ + public MountTarget withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the MountTarget object itself. + */ + public MountTarget withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the mountTargetId value + */ + public String mountTargetId() { + return this.mountTargetId; + } + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the fileSystemId value + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set uUID v4 used to identify the MountTarget. + * + * @param fileSystemId the fileSystemId value to set + * @return the MountTarget object itself. + */ + public MountTarget withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the mount target's IPv4 address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the SMB server's Fully Qualified Domain Name, FQDN. + * + * @return the smbServerFqdn value + */ + public String smbServerFqdn() { + return this.smbServerFqdn; + } + + /** + * Set the SMB server's Fully Qualified Domain Name, FQDN. + * + * @param smbServerFqdn the smbServerFqdn value to set + * @return the MountTarget object itself. + */ + public MountTarget withSmbServerFqdn(String smbServerFqdn) { + this.smbServerFqdn = smbServerFqdn; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTargetProperties.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTargetProperties.java new file mode 100644 index 0000000000000..914dafe42c52b --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/MountTargetProperties.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Mount target properties. + */ +public class MountTargetProperties { + /** + * mountTargetId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "mountTargetId", access = JsonProperty.Access.WRITE_ONLY) + private String mountTargetId; + + /** + * fileSystemId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "fileSystemId", required = true) + private String fileSystemId; + + /** + * ipAddress. + * The mount target's IPv4 address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * smbServerFQDN. + * The SMB server's Fully Qualified Domain Name, FQDN. + */ + @JsonProperty(value = "smbServerFqdn") + private String smbServerFqdn; + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the mountTargetId value + */ + public String mountTargetId() { + return this.mountTargetId; + } + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the fileSystemId value + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set uUID v4 used to identify the MountTarget. + * + * @param fileSystemId the fileSystemId value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the mount target's IPv4 address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the SMB server's Fully Qualified Domain Name, FQDN. + * + * @return the smbServerFqdn value + */ + public String smbServerFqdn() { + return this.smbServerFqdn; + } + + /** + * Set the SMB server's Fully Qualified Domain Name, FQDN. + * + * @param smbServerFqdn the smbServerFqdn value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withSmbServerFqdn(String smbServerFqdn) { + this.smbServerFqdn = smbServerFqdn; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccount.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccount.java new file mode 100644 index 0000000000000..34bf1893312b3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccount.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppManager; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppAccountInner; + +/** + * Type representing NetAppAccount. + */ +public interface NetAppAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the activeDirectories value. + */ + List activeDirectories(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the NetAppAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetAppAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetAppAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetAppAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the netappaccount definition allowing to specify ActiveDirectories. + */ + interface WithActiveDirectories { + /** + * Specifies activeDirectories. + * @param activeDirectories Active Directories + * @return the next definition stage + */ + WithCreate withActiveDirectories(List activeDirectories); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithActiveDirectories { + } + } + /** + * The template for a NetAppAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithActiveDirectories { + } + + /** + * Grouping of NetAppAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the netappaccount update allowing to specify ActiveDirectories. + */ + interface WithActiveDirectories { + /** + * Specifies activeDirectories. + * @param activeDirectories Active Directories + * @return the next update stage + */ + Update withActiveDirectories(List activeDirectories); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountBackup.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountBackup.java new file mode 100644 index 0000000000000..782087eb6a708 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountBackup.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.BackupInner; +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.netapp.v2020_07_01.implementation.NetAppManager; +import org.joda.time.DateTime; + +/** + * Type representing NetAppAccountBackup. + */ +public interface NetAppAccountBackup extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the backupId value. + */ + String backupId(); + + /** + * @return the backupType value. + */ + String backupType(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the label value. + */ + String label(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the size value. + */ + Long size(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountPatch.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountPatch.java new file mode 100644 index 0000000000000..6aa022fc4803f --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppAccountPatch.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * NetApp account patch resource. + */ +@JsonFlatten +public class NetAppAccountPatch extends Resource { + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Active Directories. + */ + @JsonProperty(value = "properties.activeDirectories") + private List activeDirectories; + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get active Directories. + * + * @return the activeDirectories value + */ + public List activeDirectories() { + return this.activeDirectories; + } + + /** + * Set active Directories. + * + * @param activeDirectories the activeDirectories value to set + * @return the NetAppAccountPatch object itself. + */ + public NetAppAccountPatch withActiveDirectories(List activeDirectories) { + this.activeDirectories = activeDirectories; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppResources.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppResources.java new file mode 100644 index 0000000000000..fcc1c202a216e --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/NetAppResources.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetAppResources. + */ +public interface NetAppResources extends HasInner { + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup); + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup); + + /** + * Check quota availability. + * Check if a quota is available. + * + * @param location The location + * @param name Name of the resource to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkQuotaAvailabilityAsync(String location, String name, CheckQuotaNameResourceTypes type, String resourceGroup); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operation.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operation.java new file mode 100644 index 0000000000000..2ba19e65f2fe9 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/OperationDisplay.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/OperationDisplay.java new file mode 100644 index 0000000000000..d7c82b59a4d16 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft NetApp. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft NetApp. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft NetApp. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set operation description. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operations.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operations.java new file mode 100644 index 0000000000000..05b76fd013077 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Operations.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/PoolChangeRequest.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/PoolChangeRequest.java new file mode 100644 index 0000000000000..c417850631b4f --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/PoolChangeRequest.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Pool change request. + */ +public class PoolChangeRequest { + /** + * Resource id of the pool to move volume to. + */ + @JsonProperty(value = "newPoolResourceId", required = true) + private String newPoolResourceId; + + /** + * Get resource id of the pool to move volume to. + * + * @return the newPoolResourceId value + */ + public String newPoolResourceId() { + return this.newPoolResourceId; + } + + /** + * Set resource id of the pool to move volume to. + * + * @param newPoolResourceId the newPoolResourceId value to set + * @return the PoolChangeRequest object itself. + */ + public PoolChangeRequest withNewPoolResourceId(String newPoolResourceId) { + this.newPoolResourceId = newPoolResourceId; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Pools.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Pools.java new file mode 100644 index 0000000000000..eda6629150857 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Pools.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.PoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Pools. + */ +public interface Pools extends SupportsCreating, HasInner { + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName); + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QosType.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QosType.java new file mode 100644 index 0000000000000..4bc4f198d5330 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QosType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for QosType. + */ +public final class QosType extends ExpandableStringEnum { + /** Static value Auto for QosType. */ + public static final QosType AUTO = fromString("Auto"); + + /** Static value Manual for QosType. */ + public static final QosType MANUAL = fromString("Manual"); + + /** + * Creates or finds a QosType from its string representation. + * @param name a name to look for + * @return the corresponding QosType + */ + @JsonCreator + public static QosType fromString(String name) { + return fromString(name, QosType.class); + } + + /** + * @return known QosType values + */ + public static Collection values() { + return values(QosType.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QuotaAvailabilityRequest.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QuotaAvailabilityRequest.java new file mode 100644 index 0000000000000..d8b746b63c7b3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/QuotaAvailabilityRequest.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Quota availability request content. + */ +public class QuotaAvailabilityRequest { + /** + * Name of the resource to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type used for verification. Possible values include: + * 'Microsoft.NetApp/netAppAccounts', + * 'Microsoft.NetApp/netAppAccounts/capacityPools', + * 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', + * 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + */ + @JsonProperty(value = "type", required = true) + private CheckQuotaNameResourceTypes type; + + /** + * Resource group name. + */ + @JsonProperty(value = "resourceGroup", required = true) + private String resourceGroup; + + /** + * Get name of the resource to verify. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the resource to verify. + * + * @param name the name value to set + * @return the QuotaAvailabilityRequest object itself. + */ + public QuotaAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + * + * @return the type value + */ + public CheckQuotaNameResourceTypes type() { + return this.type; + } + + /** + * Set resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + * + * @param type the type value to set + * @return the QuotaAvailabilityRequest object itself. + */ + public QuotaAvailabilityRequest withType(CheckQuotaNameResourceTypes type) { + this.type = type; + return this; + } + + /** + * Get resource group name. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set resource group name. + * + * @param resourceGroup the resourceGroup value to set + * @return the QuotaAvailabilityRequest object itself. + */ + public QuotaAvailabilityRequest withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/RelationshipStatus.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/RelationshipStatus.java new file mode 100644 index 0000000000000..013df1ba2838f --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/RelationshipStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RelationshipStatus. + */ +public final class RelationshipStatus extends ExpandableStringEnum { + /** Static value Idle for RelationshipStatus. */ + public static final RelationshipStatus IDLE = fromString("Idle"); + + /** Static value Transferring for RelationshipStatus. */ + public static final RelationshipStatus TRANSFERRING = fromString("Transferring"); + + /** + * Creates or finds a RelationshipStatus from its string representation. + * @param name a name to look for + * @return the corresponding RelationshipStatus + */ + @JsonCreator + public static RelationshipStatus fromString(String name) { + return fromString(name, RelationshipStatus.class); + } + + /** + * @return known RelationshipStatus values + */ + public static Collection values() { + return values(RelationshipStatus.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationObject.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationObject.java new file mode 100644 index 0000000000000..e1d9b5e576e29 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationObject.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Replication properties. + */ +public class ReplicationObject { + /** + * Id. + */ + @JsonProperty(value = "replicationId") + private String replicationId; + + /** + * Indicates whether the local volume is the source or destination for the + * Volume Replication. Possible values include: 'src', 'dst'. + */ + @JsonProperty(value = "endpointType") + private EndpointType endpointType; + + /** + * Schedule. Possible values include: '_10minutely', 'hourly', 'daily'. + */ + @JsonProperty(value = "replicationSchedule", required = true) + private ReplicationSchedule replicationSchedule; + + /** + * The resource ID of the remote volume. + */ + @JsonProperty(value = "remoteVolumeResourceId", required = true) + private String remoteVolumeResourceId; + + /** + * The remote region for the other end of the Volume Replication. + */ + @JsonProperty(value = "remoteVolumeRegion") + private String remoteVolumeRegion; + + /** + * Get id. + * + * @return the replicationId value + */ + public String replicationId() { + return this.replicationId; + } + + /** + * Set id. + * + * @param replicationId the replicationId value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withReplicationId(String replicationId) { + this.replicationId = replicationId; + return this; + } + + /** + * Get indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'src', 'dst'. + * + * @return the endpointType value + */ + public EndpointType endpointType() { + return this.endpointType; + } + + /** + * Set indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'src', 'dst'. + * + * @param endpointType the endpointType value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withEndpointType(EndpointType endpointType) { + this.endpointType = endpointType; + return this; + } + + /** + * Get schedule. Possible values include: '_10minutely', 'hourly', 'daily'. + * + * @return the replicationSchedule value + */ + public ReplicationSchedule replicationSchedule() { + return this.replicationSchedule; + } + + /** + * Set schedule. Possible values include: '_10minutely', 'hourly', 'daily'. + * + * @param replicationSchedule the replicationSchedule value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withReplicationSchedule(ReplicationSchedule replicationSchedule) { + this.replicationSchedule = replicationSchedule; + return this; + } + + /** + * Get the resource ID of the remote volume. + * + * @return the remoteVolumeResourceId value + */ + public String remoteVolumeResourceId() { + return this.remoteVolumeResourceId; + } + + /** + * Set the resource ID of the remote volume. + * + * @param remoteVolumeResourceId the remoteVolumeResourceId value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withRemoteVolumeResourceId(String remoteVolumeResourceId) { + this.remoteVolumeResourceId = remoteVolumeResourceId; + return this; + } + + /** + * Get the remote region for the other end of the Volume Replication. + * + * @return the remoteVolumeRegion value + */ + public String remoteVolumeRegion() { + return this.remoteVolumeRegion; + } + + /** + * Set the remote region for the other end of the Volume Replication. + * + * @param remoteVolumeRegion the remoteVolumeRegion value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withRemoteVolumeRegion(String remoteVolumeRegion) { + this.remoteVolumeRegion = remoteVolumeRegion; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationSchedule.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationSchedule.java new file mode 100644 index 0000000000000..67f915fb0ad69 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationSchedule.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicationSchedule. + */ +public final class ReplicationSchedule extends ExpandableStringEnum { + /** Static value _10minutely for ReplicationSchedule. */ + public static final ReplicationSchedule _10MINUTELY = fromString("_10minutely"); + + /** Static value hourly for ReplicationSchedule. */ + public static final ReplicationSchedule HOURLY = fromString("hourly"); + + /** Static value daily for ReplicationSchedule. */ + public static final ReplicationSchedule DAILY = fromString("daily"); + + /** + * Creates or finds a ReplicationSchedule from its string representation. + * @param name a name to look for + * @return the corresponding ReplicationSchedule + */ + @JsonCreator + public static ReplicationSchedule fromString(String name) { + return fromString(name, ReplicationSchedule.class); + } + + /** + * @return known ReplicationSchedule values + */ + public static Collection values() { + return values(ReplicationSchedule.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationStatus.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationStatus.java new file mode 100644 index 0000000000000..98d9c10535d2c --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ReplicationStatus.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.ReplicationStatusInner; + +/** + * Type representing ReplicationStatus. + */ +public interface ReplicationStatus extends HasInner, HasManager { + /** + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * @return the healthy value. + */ + Boolean healthy(); + + /** + * @return the mirrorState value. + */ + MirrorState mirrorState(); + + /** + * @return the relationshipStatus value. + */ + RelationshipStatus relationshipStatus(); + + /** + * @return the totalProgress value. + */ + String totalProgress(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ResourceNameAvailabilityRequest.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ResourceNameAvailabilityRequest.java new file mode 100644 index 0000000000000..aa44d177e30d3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ResourceNameAvailabilityRequest.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource name availability request content. + */ +public class ResourceNameAvailabilityRequest { + /** + * Resource name to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type used for verification. Possible values include: + * 'Microsoft.NetApp/netAppAccounts', + * 'Microsoft.NetApp/netAppAccounts/capacityPools', + * 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', + * 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + */ + @JsonProperty(value = "type", required = true) + private CheckNameResourceTypes type; + + /** + * Resource group name. + */ + @JsonProperty(value = "resourceGroup", required = true) + private String resourceGroup; + + /** + * Get resource name to verify. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name to verify. + * + * @param name the name value to set + * @return the ResourceNameAvailabilityRequest object itself. + */ + public ResourceNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + * + * @return the type value + */ + public CheckNameResourceTypes type() { + return this.type; + } + + /** + * Set resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + * + * @param type the type value to set + * @return the ResourceNameAvailabilityRequest object itself. + */ + public ResourceNameAvailabilityRequest withType(CheckNameResourceTypes type) { + this.type = type; + return this; + } + + /** + * Get resource group name. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set resource group name. + * + * @param resourceGroup the resourceGroup value to set + * @return the ResourceNameAvailabilityRequest object itself. + */ + public ResourceNameAvailabilityRequest withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SecurityStyle.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SecurityStyle.java new file mode 100644 index 0000000000000..2f3a4013e520d --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SecurityStyle.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecurityStyle. + */ +public final class SecurityStyle extends ExpandableStringEnum { + /** Static value ntfs for SecurityStyle. */ + public static final SecurityStyle NTFS = fromString("ntfs"); + + /** Static value unix for SecurityStyle. */ + public static final SecurityStyle UNIX = fromString("unix"); + + /** + * Creates or finds a SecurityStyle from its string representation. + * @param name a name to look for + * @return the corresponding SecurityStyle + */ + @JsonCreator + public static SecurityStyle fromString(String name) { + return fromString(name, SecurityStyle.class); + } + + /** + * @return known SecurityStyle values + */ + public static Collection values() { + return values(SecurityStyle.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceLevel.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceLevel.java new file mode 100644 index 0000000000000..88bd634bc6d9d --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceLevel.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceLevel. + */ +public final class ServiceLevel extends ExpandableStringEnum { + /** Static value Standard for ServiceLevel. */ + public static final ServiceLevel STANDARD = fromString("Standard"); + + /** Static value Premium for ServiceLevel. */ + public static final ServiceLevel PREMIUM = fromString("Premium"); + + /** Static value Ultra for ServiceLevel. */ + public static final ServiceLevel ULTRA = fromString("Ultra"); + + /** + * Creates or finds a ServiceLevel from its string representation. + * @param name a name to look for + * @return the corresponding ServiceLevel + */ + @JsonCreator + public static ServiceLevel fromString(String name) { + return fromString(name, ServiceLevel.class); + } + + /** + * @return known ServiceLevel values + */ + public static Collection values() { + return values(ServiceLevel.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceSpecification.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceSpecification.java new file mode 100644 index 0000000000000..b0e2d1b39c677 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/ServiceSpecification.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * One property of operation, include metric specifications. + */ +public class ServiceSpecification { + /** + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get metric specifications of operation. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshot.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshot.java new file mode 100644 index 0000000000000..5467c4169ddbf --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshot.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.SnapshotInner; +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.netapp.v2020_07_01.implementation.NetAppManager; +import org.joda.time.DateTime; + +/** + * Type representing Snapshot. + */ +public interface Snapshot extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the snapshotId value. + */ + String snapshotId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Snapshot definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVolume, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of Snapshot definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Snapshot definition. + */ + interface Blank extends WithVolume { + } + + /** + * The stage of the snapshot definition allowing to specify Volume. + */ + interface WithVolume { + /** + * Specifies resourceGroupName, accountName, poolName, volumeName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @return the next definition stage + */ + WithLocation withExistingVolume(String resourceGroupName, String accountName, String poolName, String volumeName); + } + + /** + * The stage of the snapshot 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 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 { + } + } + /** + * The template for a Snapshot update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBody { + } + + /** + * Grouping of Snapshot update stages. + */ + interface UpdateStages { + /** + * The stage of the snapshot update allowing to specify Body. + */ + interface WithBody { + /** + * Specifies body. + * @param body Snapshot object supplied in the body of the operation + * @return the next update stage + */ + Update withBody(Object body); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicies.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicies.java new file mode 100644 index 0000000000000..f832dbfdc2def --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicies.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.SnapshotPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SnapshotPolicies. + */ +public interface SnapshotPolicies extends SupportsCreating, HasInner { + /** + * Get a snapshot Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * Get volumes associated with snapshot policy. + * Get volumes associated with snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVolumesAsync(String resourceGroupName, String accountName, String snapshotPolicyName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicy.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicy.java new file mode 100644 index 0000000000000..5002762d7d64b --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicy.java @@ -0,0 +1,302 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.SnapshotPolicyInner; +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.netapp.v2020_07_01.implementation.NetAppManager; +import java.util.Map; + +/** + * Type representing SnapshotPolicy. + */ +public interface SnapshotPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the dailySchedule value. + */ + DailySchedule dailySchedule(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the hourlySchedule value. + */ + HourlySchedule hourlySchedule(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the monthlySchedule value. + */ + MonthlySchedule monthlySchedule(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the name1 value. + */ + String name1(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the weeklySchedule value. + */ + WeeklySchedule weeklySchedule(); + + /** + * The entirety of the SnapshotPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetAppAccount, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of SnapshotPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SnapshotPolicy definition. + */ + interface Blank extends WithNetAppAccount { + } + + /** + * The stage of the snapshotpolicy definition allowing to specify NetAppAccount. + */ + interface WithNetAppAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @return the next definition stage + */ + WithLocation withExistingNetAppAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the snapshotpolicy definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the location parameter value + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the snapshotpolicy definition allowing to specify DailySchedule. + */ + interface WithDailySchedule { + /** + * Specifies dailySchedule. + * @param dailySchedule Schedule for daily snapshots + * @return the next definition stage + */ + WithCreate withDailySchedule(DailySchedule dailySchedule); + } + + /** + * The stage of the snapshotpolicy definition allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled The property to decide policy is enabled or not + * @return the next definition stage + */ + WithCreate withEnabled(Boolean enabled); + } + + /** + * The stage of the snapshotpolicy definition allowing to specify HourlySchedule. + */ + interface WithHourlySchedule { + /** + * Specifies hourlySchedule. + * @param hourlySchedule Schedule for hourly snapshots + * @return the next definition stage + */ + WithCreate withHourlySchedule(HourlySchedule hourlySchedule); + } + + /** + * The stage of the snapshotpolicy definition allowing to specify MonthlySchedule. + */ + interface WithMonthlySchedule { + /** + * Specifies monthlySchedule. + * @param monthlySchedule Schedule for monthly snapshots + * @return the next definition stage + */ + WithCreate withMonthlySchedule(MonthlySchedule monthlySchedule); + } + + /** + * The stage of the snapshotpolicy definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the snapshotpolicy definition allowing to specify WeeklySchedule. + */ + interface WithWeeklySchedule { + /** + * Specifies weeklySchedule. + * @param weeklySchedule Schedule for weekly snapshots + * @return the next definition stage + */ + WithCreate withWeeklySchedule(WeeklySchedule weeklySchedule); + } + + /** + * 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.WithDailySchedule, DefinitionStages.WithEnabled, DefinitionStages.WithHourlySchedule, DefinitionStages.WithMonthlySchedule, DefinitionStages.WithTags, DefinitionStages.WithWeeklySchedule { + } + } + /** + * The template for a SnapshotPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDailySchedule, UpdateStages.WithEnabled, UpdateStages.WithHourlySchedule, UpdateStages.WithLocation, UpdateStages.WithMonthlySchedule, UpdateStages.WithTags, UpdateStages.WithWeeklySchedule { + } + + /** + * Grouping of SnapshotPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the snapshotpolicy update allowing to specify DailySchedule. + */ + interface WithDailySchedule { + /** + * Specifies dailySchedule. + * @param dailySchedule Schedule for daily snapshots + * @return the next update stage + */ + Update withDailySchedule(DailySchedule dailySchedule); + } + + /** + * The stage of the snapshotpolicy update allowing to specify Enabled. + */ + interface WithEnabled { + /** + * Specifies enabled. + * @param enabled The property to decide policy is enabled or not + * @return the next update stage + */ + Update withEnabled(Boolean enabled); + } + + /** + * The stage of the snapshotpolicy update allowing to specify HourlySchedule. + */ + interface WithHourlySchedule { + /** + * Specifies hourlySchedule. + * @param hourlySchedule Schedule for hourly snapshots + * @return the next update stage + */ + Update withHourlySchedule(HourlySchedule hourlySchedule); + } + + /** + * The stage of the snapshotpolicy 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 snapshotpolicy update allowing to specify MonthlySchedule. + */ + interface WithMonthlySchedule { + /** + * Specifies monthlySchedule. + * @param monthlySchedule Schedule for monthly snapshots + * @return the next update stage + */ + Update withMonthlySchedule(MonthlySchedule monthlySchedule); + } + + /** + * The stage of the snapshotpolicy update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the snapshotpolicy update allowing to specify WeeklySchedule. + */ + interface WithWeeklySchedule { + /** + * Specifies weeklySchedule. + * @param weeklySchedule Schedule for weekly snapshots + * @return the next update stage + */ + Update withWeeklySchedule(WeeklySchedule weeklySchedule); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyDetails.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyDetails.java new file mode 100644 index 0000000000000..e8b0ab36bc199 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyDetails.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Snapshot policy properties. + */ +@JsonFlatten +public class SnapshotPolicyDetails { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Snapshot policy name. + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String name1; + + /** + * hourlySchedule. + * Schedule for hourly snapshots. + */ + @JsonProperty(value = "properties.hourlySchedule") + private HourlySchedule hourlySchedule; + + /** + * dailySchedule. + * Schedule for daily snapshots. + */ + @JsonProperty(value = "properties.dailySchedule") + private DailySchedule dailySchedule; + + /** + * weeklySchedule. + * Schedule for weekly snapshots. + */ + @JsonProperty(value = "properties.weeklySchedule") + private WeeklySchedule weeklySchedule; + + /** + * monthlySchedule. + * Schedule for monthly snapshots. + */ + @JsonProperty(value = "properties.monthlySchedule") + private MonthlySchedule monthlySchedule; + + /** + * The property to decide policy is enabled or not. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the SnapshotPolicyDetails object itself. + */ + public SnapshotPolicyDetails withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the SnapshotPolicyDetails object itself. + */ + public SnapshotPolicyDetails withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get snapshot policy name. + * + * @return the name1 value + */ + public String name1() { + return this.name1; + } + + /** + * Get schedule for hourly snapshots. + * + * @return the hourlySchedule value + */ + public HourlySchedule hourlySchedule() { + return this.hourlySchedule; + } + + /** + * Set schedule for hourly snapshots. + * + * @param hourlySchedule the hourlySchedule value to set + * @return the SnapshotPolicyDetails object itself. + */ + public SnapshotPolicyDetails withHourlySchedule(HourlySchedule hourlySchedule) { + this.hourlySchedule = hourlySchedule; + return this; + } + + /** + * Get schedule for daily snapshots. + * + * @return the dailySchedule value + */ + public DailySchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set schedule for daily snapshots. + * + * @param dailySchedule the dailySchedule value to set + * @return the SnapshotPolicyDetails object itself. + */ + public SnapshotPolicyDetails withDailySchedule(DailySchedule dailySchedule) { + this.dailySchedule = dailySchedule; + return this; + } + + /** + * Get schedule for weekly snapshots. + * + * @return the weeklySchedule value + */ + public WeeklySchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set schedule for weekly snapshots. + * + * @param weeklySchedule the weeklySchedule value to set + * @return the SnapshotPolicyDetails object itself. + */ + public SnapshotPolicyDetails withWeeklySchedule(WeeklySchedule weeklySchedule) { + this.weeklySchedule = weeklySchedule; + return this; + } + + /** + * Get schedule for monthly snapshots. + * + * @return the monthlySchedule value + */ + public MonthlySchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set schedule for monthly snapshots. + * + * @param monthlySchedule the monthlySchedule value to set + * @return the SnapshotPolicyDetails object itself. + */ + public SnapshotPolicyDetails withMonthlySchedule(MonthlySchedule monthlySchedule) { + this.monthlySchedule = monthlySchedule; + return this; + } + + /** + * Get the property to decide policy is enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the property to decide policy is enabled or not. + * + * @param enabled the enabled value to set + * @return the SnapshotPolicyDetails object itself. + */ + public SnapshotPolicyDetails withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyPatch.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyPatch.java new file mode 100644 index 0000000000000..463e4b594c612 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyPatch.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Snapshot policy Details for create and update. + */ +@JsonFlatten +public class SnapshotPolicyPatch { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Snapshot policy name. + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String name1; + + /** + * hourlySchedule. + * Schedule for hourly snapshots. + */ + @JsonProperty(value = "properties.hourlySchedule") + private HourlySchedule hourlySchedule; + + /** + * dailySchedule. + * Schedule for daily snapshots. + */ + @JsonProperty(value = "properties.dailySchedule") + private DailySchedule dailySchedule; + + /** + * weeklySchedule. + * Schedule for weekly snapshots. + */ + @JsonProperty(value = "properties.weeklySchedule") + private WeeklySchedule weeklySchedule; + + /** + * monthlySchedule. + * Schedule for monthly snapshots. + */ + @JsonProperty(value = "properties.monthlySchedule") + private MonthlySchedule monthlySchedule; + + /** + * The property to decide policy is enabled or not. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the SnapshotPolicyPatch object itself. + */ + public SnapshotPolicyPatch withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the SnapshotPolicyPatch object itself. + */ + public SnapshotPolicyPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get snapshot policy name. + * + * @return the name1 value + */ + public String name1() { + return this.name1; + } + + /** + * Get schedule for hourly snapshots. + * + * @return the hourlySchedule value + */ + public HourlySchedule hourlySchedule() { + return this.hourlySchedule; + } + + /** + * Set schedule for hourly snapshots. + * + * @param hourlySchedule the hourlySchedule value to set + * @return the SnapshotPolicyPatch object itself. + */ + public SnapshotPolicyPatch withHourlySchedule(HourlySchedule hourlySchedule) { + this.hourlySchedule = hourlySchedule; + return this; + } + + /** + * Get schedule for daily snapshots. + * + * @return the dailySchedule value + */ + public DailySchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set schedule for daily snapshots. + * + * @param dailySchedule the dailySchedule value to set + * @return the SnapshotPolicyPatch object itself. + */ + public SnapshotPolicyPatch withDailySchedule(DailySchedule dailySchedule) { + this.dailySchedule = dailySchedule; + return this; + } + + /** + * Get schedule for weekly snapshots. + * + * @return the weeklySchedule value + */ + public WeeklySchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set schedule for weekly snapshots. + * + * @param weeklySchedule the weeklySchedule value to set + * @return the SnapshotPolicyPatch object itself. + */ + public SnapshotPolicyPatch withWeeklySchedule(WeeklySchedule weeklySchedule) { + this.weeklySchedule = weeklySchedule; + return this; + } + + /** + * Get schedule for monthly snapshots. + * + * @return the monthlySchedule value + */ + public MonthlySchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set schedule for monthly snapshots. + * + * @param monthlySchedule the monthlySchedule value to set + * @return the SnapshotPolicyPatch object itself. + */ + public SnapshotPolicyPatch withMonthlySchedule(MonthlySchedule monthlySchedule) { + this.monthlySchedule = monthlySchedule; + return this; + } + + /** + * Get the property to decide policy is enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the property to decide policy is enabled or not. + * + * @param enabled the enabled value to set + * @return the SnapshotPolicyPatch object itself. + */ + public SnapshotPolicyPatch withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyVolumeList.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyVolumeList.java new file mode 100644 index 0000000000000..1e9fb56ff14bb --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/SnapshotPolicyVolumeList.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.SnapshotPolicyVolumeListInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.VolumeInner; +import java.util.List; + +/** + * Type representing SnapshotPolicyVolumeList. + */ +public interface SnapshotPolicyVolumeList extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshots.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshots.java new file mode 100644 index 0000000000000..6e1c733320962 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Snapshots.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.SnapshotsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Snapshots. + */ +public interface Snapshots extends SupportsCreating, HasInner { + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vault.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vault.java new file mode 100644 index 0000000000000..7a930c8ff7b38 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vault.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.VaultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.NetAppManager; + +/** + * Type representing Vault. + */ +public interface Vault extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vaultName value. + */ + String vaultName(); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vaults.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vaults.java new file mode 100644 index 0000000000000..891885b070dc3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Vaults.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.VaultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Vaults. + */ +public interface Vaults extends HasInner { + /** + * List vaults. + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volume.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volume.java new file mode 100644 index 0000000000000..f0109c446ad27 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volume.java @@ -0,0 +1,484 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.VolumeInner; +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.netapp.v2020_07_01.implementation.NetAppManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing Volume. + */ +public interface Volume extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the backupId value. + */ + String backupId(); + + /** + * @return the baremetalTenantId value. + */ + String baremetalTenantId(); + + /** + * @return the creationToken value. + */ + String creationToken(); + + /** + * @return the dataProtection value. + */ + VolumePropertiesDataProtection dataProtection(); + + /** + * @return the exportPolicy value. + */ + VolumePropertiesExportPolicy exportPolicy(); + + /** + * @return the fileSystemId value. + */ + String fileSystemId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isRestoring value. + */ + Boolean isRestoring(); + + /** + * @return the kerberosEnabled value. + */ + Boolean kerberosEnabled(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mountTargets value. + */ + List mountTargets(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocolTypes value. + */ + List protocolTypes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the securityStyle value. + */ + SecurityStyle securityStyle(); + + /** + * @return the serviceLevel value. + */ + ServiceLevel serviceLevel(); + + /** + * @return the snapshotDirectoryVisible value. + */ + Boolean snapshotDirectoryVisible(); + + /** + * @return the snapshotId value. + */ + String snapshotId(); + + /** + * @return the subnetId value. + */ + String subnetId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the throughputMibps value. + */ + Double throughputMibps(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the usageThreshold value. + */ + long usageThreshold(); + + /** + * @return the volumeType value. + */ + String volumeType(); + + /** + * The entirety of the Volume definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCapacityPool, DefinitionStages.WithCreationToken, DefinitionStages.WithLocation, DefinitionStages.WithSubnetId, DefinitionStages.WithUsageThreshold, DefinitionStages.WithCreate { + } + + /** + * Grouping of Volume definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Volume definition. + */ + interface Blank extends WithCapacityPool { + } + + /** + * The stage of the volume definition allowing to specify CapacityPool. + */ + interface WithCapacityPool { + /** + * Specifies resourceGroupName, accountName, poolName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @return the next definition stage + */ + WithCreationToken withExistingCapacityPool(String resourceGroupName, String accountName, String poolName); + } + + /** + * The stage of the volume definition allowing to specify CreationToken. + */ + interface WithCreationToken { + /** + * Specifies creationToken. + * @param creationToken A unique file path for the volume. Used when creating mount targets + * @return the next definition stage + */ + WithLocation withCreationToken(String creationToken); + } + + /** + * The stage of the volume definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the location parameter value + * @return the next definition stage + */ + WithSubnetId withLocation(String location); + } + + /** + * The stage of the volume definition allowing to specify SubnetId. + */ + interface WithSubnetId { + /** + * Specifies subnetId. + * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes + * @return the next definition stage + */ + WithUsageThreshold withSubnetId(String subnetId); + } + + /** + * The stage of the volume definition allowing to specify UsageThreshold. + */ + interface WithUsageThreshold { + /** + * Specifies usageThreshold. + * @param usageThreshold Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes + * @return the next definition stage + */ + WithCreate withUsageThreshold(long usageThreshold); + } + + /** + * The stage of the volume definition allowing to specify BackupId. + */ + interface WithBackupId { + /** + * Specifies backupId. + * @param backupId UUID v4 or resource identifier used to identify the Backup + * @return the next definition stage + */ + WithCreate withBackupId(String backupId); + } + + /** + * The stage of the volume definition allowing to specify DataProtection. + */ + interface WithDataProtection { + /** + * Specifies dataProtection. + * @param dataProtection DataProtection type volumes include an object containing details of the replication + * @return the next definition stage + */ + WithCreate withDataProtection(VolumePropertiesDataProtection dataProtection); + } + + /** + * The stage of the volume definition allowing to specify ExportPolicy. + */ + interface WithExportPolicy { + /** + * Specifies exportPolicy. + * @param exportPolicy Set of export policy rules + * @return the next definition stage + */ + WithCreate withExportPolicy(VolumePropertiesExportPolicy exportPolicy); + } + + /** + * The stage of the volume definition allowing to specify IsRestoring. + */ + interface WithIsRestoring { + /** + * Specifies isRestoring. + * @param isRestoring Restoring + * @return the next definition stage + */ + WithCreate withIsRestoring(Boolean isRestoring); + } + + /** + * The stage of the volume definition allowing to specify KerberosEnabled. + */ + interface WithKerberosEnabled { + /** + * Specifies kerberosEnabled. + * @param kerberosEnabled Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later + * @return the next definition stage + */ + WithCreate withKerberosEnabled(Boolean kerberosEnabled); + } + + /** + * The stage of the volume definition allowing to specify MountTargets. + */ + interface WithMountTargets { + /** + * Specifies mountTargets. + * @param mountTargets List of mount targets + * @return the next definition stage + */ + WithCreate withMountTargets(List mountTargets); + } + + /** + * The stage of the volume definition allowing to specify ProtocolTypes. + */ + interface WithProtocolTypes { + /** + * Specifies protocolTypes. + * @param protocolTypes Set of protocol types + * @return the next definition stage + */ + WithCreate withProtocolTypes(List protocolTypes); + } + + /** + * The stage of the volume definition allowing to specify SecurityStyle. + */ + interface WithSecurityStyle { + /** + * Specifies securityStyle. + * @param securityStyle The security style of volume. Possible values include: 'ntfs', 'unix' + * @return the next definition stage + */ + WithCreate withSecurityStyle(SecurityStyle securityStyle); + } + + /** + * The stage of the volume definition allowing to specify ServiceLevel. + */ + interface WithServiceLevel { + /** + * Specifies serviceLevel. + * @param serviceLevel The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + * @return the next definition stage + */ + WithCreate withServiceLevel(ServiceLevel serviceLevel); + } + + /** + * The stage of the volume definition allowing to specify SnapshotDirectoryVisible. + */ + interface WithSnapshotDirectoryVisible { + /** + * Specifies snapshotDirectoryVisible. + * @param snapshotDirectoryVisible If enabled (true) the volume will contain a read-only .snapshot directory which provides access to each of the volume's snapshots (default to true) + * @return the next definition stage + */ + WithCreate withSnapshotDirectoryVisible(Boolean snapshotDirectoryVisible); + } + + /** + * The stage of the volume definition allowing to specify SnapshotId. + */ + interface WithSnapshotId { + /** + * Specifies snapshotId. + * @param snapshotId UUID v4 or resource identifier used to identify the Snapshot + * @return the next definition stage + */ + WithCreate withSnapshotId(String snapshotId); + } + + /** + * The stage of the volume definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the volume definition allowing to specify ThroughputMibps. + */ + interface WithThroughputMibps { + /** + * Specifies throughputMibps. + * @param throughputMibps the throughputMibps parameter value + * @return the next definition stage + */ + WithCreate withThroughputMibps(Double throughputMibps); + } + + /** + * The stage of the volume definition allowing to specify VolumeType. + */ + interface WithVolumeType { + /** + * Specifies volumeType. + * @param volumeType What type of volume is this + * @return the next definition stage + */ + WithCreate withVolumeType(String volumeType); + } + + /** + * 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.WithBackupId, DefinitionStages.WithDataProtection, DefinitionStages.WithExportPolicy, DefinitionStages.WithIsRestoring, DefinitionStages.WithKerberosEnabled, DefinitionStages.WithMountTargets, DefinitionStages.WithProtocolTypes, DefinitionStages.WithSecurityStyle, DefinitionStages.WithServiceLevel, DefinitionStages.WithSnapshotDirectoryVisible, DefinitionStages.WithSnapshotId, DefinitionStages.WithTags, DefinitionStages.WithThroughputMibps, DefinitionStages.WithVolumeType { + } + } + /** + * The template for a Volume update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDataProtection, UpdateStages.WithExportPolicy, UpdateStages.WithServiceLevel, UpdateStages.WithTags, UpdateStages.WithThroughputMibps, UpdateStages.WithUsageThreshold { + } + + /** + * Grouping of Volume update stages. + */ + interface UpdateStages { + /** + * The stage of the volume update allowing to specify DataProtection. + */ + interface WithDataProtection { + /** + * Specifies dataProtection. + * @param dataProtection DataProtection type volumes include an object containing details of the replication + * @return the next update stage + */ + Update withDataProtection(VolumePatchPropertiesDataProtection dataProtection); + } + + /** + * The stage of the volume update allowing to specify ExportPolicy. + */ + interface WithExportPolicy { + /** + * Specifies exportPolicy. + * @param exportPolicy Set of export policy rules + * @return the next update stage + */ + Update withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy); + } + + /** + * The stage of the volume update allowing to specify ServiceLevel. + */ + interface WithServiceLevel { + /** + * Specifies serviceLevel. + * @param serviceLevel The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + * @return the next update stage + */ + Update withServiceLevel(ServiceLevel serviceLevel); + } + + /** + * The stage of the volume update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the volume update allowing to specify ThroughputMibps. + */ + interface WithThroughputMibps { + /** + * Specifies throughputMibps. + * @param throughputMibps the throughputMibps parameter value + * @return the next update stage + */ + Update withThroughputMibps(Double throughputMibps); + } + + /** + * The stage of the volume update allowing to specify UsageThreshold. + */ + interface WithUsageThreshold { + /** + * Specifies usageThreshold. + * @param usageThreshold Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes + * @return the next update stage + */ + Update withUsageThreshold(Long usageThreshold); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackupProperties.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackupProperties.java new file mode 100644 index 0000000000000..05283141b8ea2 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackupProperties.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Volume Backup Properties. + */ +public class VolumeBackupProperties { + /** + * Backup Policy Resource ID. + */ + @JsonProperty(value = "backupPolicyId") + private String backupPolicyId; + + /** + * Policy Enforced. + */ + @JsonProperty(value = "policyEnforced") + private Boolean policyEnforced; + + /** + * Vault Resource ID. + */ + @JsonProperty(value = "vaultId") + private String vaultId; + + /** + * Backup Enabled. + */ + @JsonProperty(value = "backupEnabled") + private Boolean backupEnabled; + + /** + * Get backup Policy Resource ID. + * + * @return the backupPolicyId value + */ + public String backupPolicyId() { + return this.backupPolicyId; + } + + /** + * Set backup Policy Resource ID. + * + * @param backupPolicyId the backupPolicyId value to set + * @return the VolumeBackupProperties object itself. + */ + public VolumeBackupProperties withBackupPolicyId(String backupPolicyId) { + this.backupPolicyId = backupPolicyId; + return this; + } + + /** + * Get policy Enforced. + * + * @return the policyEnforced value + */ + public Boolean policyEnforced() { + return this.policyEnforced; + } + + /** + * Set policy Enforced. + * + * @param policyEnforced the policyEnforced value to set + * @return the VolumeBackupProperties object itself. + */ + public VolumeBackupProperties withPolicyEnforced(Boolean policyEnforced) { + this.policyEnforced = policyEnforced; + return this; + } + + /** + * Get vault Resource ID. + * + * @return the vaultId value + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Set vault Resource ID. + * + * @param vaultId the vaultId value to set + * @return the VolumeBackupProperties object itself. + */ + public VolumeBackupProperties withVaultId(String vaultId) { + this.vaultId = vaultId; + return this; + } + + /** + * Get backup Enabled. + * + * @return the backupEnabled value + */ + public Boolean backupEnabled() { + return this.backupEnabled; + } + + /** + * Set backup Enabled. + * + * @param backupEnabled the backupEnabled value to set + * @return the VolumeBackupProperties object itself. + */ + public VolumeBackupProperties withBackupEnabled(Boolean backupEnabled) { + this.backupEnabled = backupEnabled; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackups.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackups.java new file mode 100644 index 0000000000000..19cbd843504df --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeBackups.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Volume details using the backup policy. + */ +public class VolumeBackups { + /** + * Volume name. + */ + @JsonProperty(value = "volumeName") + private String volumeName; + + /** + * Total count of backups for volume. + */ + @JsonProperty(value = "backupsCount") + private Integer backupsCount; + + /** + * Policy enabled. + */ + @JsonProperty(value = "policyEnabled") + private Boolean policyEnabled; + + /** + * Get volume name. + * + * @return the volumeName value + */ + public String volumeName() { + return this.volumeName; + } + + /** + * Set volume name. + * + * @param volumeName the volumeName value to set + * @return the VolumeBackups object itself. + */ + public VolumeBackups withVolumeName(String volumeName) { + this.volumeName = volumeName; + return this; + } + + /** + * Get total count of backups for volume. + * + * @return the backupsCount value + */ + public Integer backupsCount() { + return this.backupsCount; + } + + /** + * Set total count of backups for volume. + * + * @param backupsCount the backupsCount value to set + * @return the VolumeBackups object itself. + */ + public VolumeBackups withBackupsCount(Integer backupsCount) { + this.backupsCount = backupsCount; + return this; + } + + /** + * Get policy enabled. + * + * @return the policyEnabled value + */ + public Boolean policyEnabled() { + return this.policyEnabled; + } + + /** + * Set policy enabled. + * + * @param policyEnabled the policyEnabled value to set + * @return the VolumeBackups object itself. + */ + public VolumeBackups withPolicyEnabled(Boolean policyEnabled) { + this.policyEnabled = policyEnabled; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatch.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatch.java new file mode 100644 index 0000000000000..50d24c3fae7c2 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatch.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Volume patch resource. + */ +@JsonFlatten +public class VolumePatch extends Resource { + /** + * serviceLevel. + * The service level of the file system. Possible values include: + * 'Standard', 'Premium', 'Ultra'. + */ + @JsonProperty(value = "properties.serviceLevel") + private ServiceLevel serviceLevel; + + /** + * usageThreshold. + * Maximum storage quota allowed for a file system in bytes. This is a soft + * quota used for alerting only. Minimum size is 100 GiB. Upper limit is + * 100TiB. Specified in bytes. + */ + @JsonProperty(value = "properties.usageThreshold") + private Long usageThreshold; + + /** + * exportPolicy. + * Set of export policy rules. + */ + @JsonProperty(value = "properties.exportPolicy") + private VolumePatchPropertiesExportPolicy exportPolicy; + + /** + * Maximum throughput in Mibps that can be achieved by this volume, value + * between 1 and 4500. + */ + @JsonProperty(value = "properties.throughputMibps") + private Double throughputMibps; + + /** + * DataProtection. + * DataProtection type volumes include an object containing details of the + * replication. + */ + @JsonProperty(value = "properties.dataProtection") + private VolumePatchPropertiesDataProtection dataProtection; + + /** + * Get the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @return the serviceLevel value + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @param serviceLevel the serviceLevel value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @return the usageThreshold value + */ + public Long usageThreshold() { + return this.usageThreshold; + } + + /** + * Set maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @param usageThreshold the usageThreshold value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withUsageThreshold(Long usageThreshold) { + this.usageThreshold = usageThreshold; + return this; + } + + /** + * Get set of export policy rules. + * + * @return the exportPolicy value + */ + public VolumePatchPropertiesExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set set of export policy rules. + * + * @param exportPolicy the exportPolicy value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy) { + this.exportPolicy = exportPolicy; + return this; + } + + /** + * Get the throughputMibps value. + * + * @return the throughputMibps value + */ + public Double throughputMibps() { + return this.throughputMibps; + } + + /** + * Set the throughputMibps value. + * + * @param throughputMibps the throughputMibps value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withThroughputMibps(Double throughputMibps) { + this.throughputMibps = throughputMibps; + return this; + } + + /** + * Get dataProtection type volumes include an object containing details of the replication. + * + * @return the dataProtection value + */ + public VolumePatchPropertiesDataProtection dataProtection() { + return this.dataProtection; + } + + /** + * Set dataProtection type volumes include an object containing details of the replication. + * + * @param dataProtection the dataProtection value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withDataProtection(VolumePatchPropertiesDataProtection dataProtection) { + this.dataProtection = dataProtection; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesDataProtection.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesDataProtection.java new file mode 100644 index 0000000000000..db89bfccf5466 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesDataProtection.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataProtection. + * DataProtection type volumes include an object containing details of the + * replication. + */ +public class VolumePatchPropertiesDataProtection { + /** + * Backup. + * Backup Properties. + */ + @JsonProperty(value = "backup") + private VolumeBackupProperties backup; + + /** + * Get backup Properties. + * + * @return the backup value + */ + public VolumeBackupProperties backup() { + return this.backup; + } + + /** + * Set backup Properties. + * + * @param backup the backup value to set + * @return the VolumePatchPropertiesDataProtection object itself. + */ + public VolumePatchPropertiesDataProtection withBackup(VolumeBackupProperties backup) { + this.backup = backup; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesExportPolicy.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesExportPolicy.java new file mode 100644 index 0000000000000..df9f49cf7f70c --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePatchPropertiesExportPolicy.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * exportPolicy. + * Set of export policy rules. + */ +public class VolumePatchPropertiesExportPolicy { + /** + * Export policy rule. + * Export policy rule. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get export policy rule. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set export policy rule. + * + * @param rules the rules value to set + * @return the VolumePatchPropertiesExportPolicy object itself. + */ + public VolumePatchPropertiesExportPolicy withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesDataProtection.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesDataProtection.java new file mode 100644 index 0000000000000..28b9fb069e103 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesDataProtection.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataProtection. + * DataProtection type volumes include an object containing details of the + * replication. + */ +public class VolumePropertiesDataProtection { + /** + * Backup. + * Backup Properties. + */ + @JsonProperty(value = "backup") + private VolumeBackupProperties backup; + + /** + * Replication. + * Replication properties. + */ + @JsonProperty(value = "replication") + private ReplicationObject replication; + + /** + * Snapshot. + * Snapshot properties. + */ + @JsonProperty(value = "snapshot") + private VolumeSnapshotProperties snapshot; + + /** + * Get backup Properties. + * + * @return the backup value + */ + public VolumeBackupProperties backup() { + return this.backup; + } + + /** + * Set backup Properties. + * + * @param backup the backup value to set + * @return the VolumePropertiesDataProtection object itself. + */ + public VolumePropertiesDataProtection withBackup(VolumeBackupProperties backup) { + this.backup = backup; + return this; + } + + /** + * Get replication properties. + * + * @return the replication value + */ + public ReplicationObject replication() { + return this.replication; + } + + /** + * Set replication properties. + * + * @param replication the replication value to set + * @return the VolumePropertiesDataProtection object itself. + */ + public VolumePropertiesDataProtection withReplication(ReplicationObject replication) { + this.replication = replication; + return this; + } + + /** + * Get snapshot properties. + * + * @return the snapshot value + */ + public VolumeSnapshotProperties snapshot() { + return this.snapshot; + } + + /** + * Set snapshot properties. + * + * @param snapshot the snapshot value to set + * @return the VolumePropertiesDataProtection object itself. + */ + public VolumePropertiesDataProtection withSnapshot(VolumeSnapshotProperties snapshot) { + this.snapshot = snapshot; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesExportPolicy.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesExportPolicy.java new file mode 100644 index 0000000000000..4ae0050f306ac --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumePropertiesExportPolicy.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * exportPolicy. + * Set of export policy rules. + */ +public class VolumePropertiesExportPolicy { + /** + * Export policy rule. + * Export policy rule. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get export policy rule. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set export policy rule. + * + * @param rules the rules value to set + * @return the VolumePropertiesExportPolicy object itself. + */ + public VolumePropertiesExportPolicy withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeRevert.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeRevert.java new file mode 100644 index 0000000000000..60c16cd09c880 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeRevert.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * revert a volume to the snapshot. + */ +public class VolumeRevert { + /** + * Resource id of the snapshot. + */ + @JsonProperty(value = "snapshotId") + private String snapshotId; + + /** + * Get resource id of the snapshot. + * + * @return the snapshotId value + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set resource id of the snapshot. + * + * @param snapshotId the snapshotId value to set + * @return the VolumeRevert object itself. + */ + public VolumeRevert withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeSnapshotProperties.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeSnapshotProperties.java new file mode 100644 index 0000000000000..12f2b266b5c7d --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/VolumeSnapshotProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Volume Snapshot Properties. + */ +public class VolumeSnapshotProperties { + /** + * Snapshot Policy ResourceId. + */ + @JsonProperty(value = "snapshotPolicyId") + private String snapshotPolicyId; + + /** + * Get snapshot Policy ResourceId. + * + * @return the snapshotPolicyId value + */ + public String snapshotPolicyId() { + return this.snapshotPolicyId; + } + + /** + * Set snapshot Policy ResourceId. + * + * @param snapshotPolicyId the snapshotPolicyId value to set + * @return the VolumeSnapshotProperties object itself. + */ + public VolumeSnapshotProperties withSnapshotPolicyId(String snapshotPolicyId) { + this.snapshotPolicyId = snapshotPolicyId; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volumes.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volumes.java new file mode 100644 index 0000000000000..fe7d1b3b2bcea --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/Volumes.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.implementation.VolumesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Volumes. + */ +public interface Volumes extends SupportsCreating, HasInner { + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable reInitializeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable poolChangeAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId); + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName, String poolName); + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/WeeklySchedule.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/WeeklySchedule.java new file mode 100644 index 0000000000000..bf424577a5290 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/WeeklySchedule.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Weekly Schedule properties, make a snapshot every week at a specific day or + * days. + */ +public class WeeklySchedule { + /** + * Weekly snapshot count to keep. + */ + @JsonProperty(value = "snapshotsToKeep") + private Integer snapshotsToKeep; + + /** + * Indicates which weekdays snapshot should be taken, accepts a comma + * separated list of week day names in english. + */ + @JsonProperty(value = "day") + private String day; + + /** + * Indicates which hour in UTC timezone a snapshot should be taken. + */ + @JsonProperty(value = "hour") + private Integer hour; + + /** + * Indicates which minute snapshot should be taken. + */ + @JsonProperty(value = "minute") + private Integer minute; + + /** + * Resource size in bytes, current storage usage for the volume in bytes. + */ + @JsonProperty(value = "usedBytes") + private Long usedBytes; + + /** + * Get weekly snapshot count to keep. + * + * @return the snapshotsToKeep value + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set weekly snapshot count to keep. + * + * @param snapshotsToKeep the snapshotsToKeep value to set + * @return the WeeklySchedule object itself. + */ + public WeeklySchedule withSnapshotsToKeep(Integer snapshotsToKeep) { + this.snapshotsToKeep = snapshotsToKeep; + return this; + } + + /** + * Get indicates which weekdays snapshot should be taken, accepts a comma separated list of week day names in english. + * + * @return the day value + */ + public String day() { + return this.day; + } + + /** + * Set indicates which weekdays snapshot should be taken, accepts a comma separated list of week day names in english. + * + * @param day the day value to set + * @return the WeeklySchedule object itself. + */ + public WeeklySchedule withDay(String day) { + this.day = day; + return this; + } + + /** + * Get indicates which hour in UTC timezone a snapshot should be taken. + * + * @return the hour value + */ + public Integer hour() { + return this.hour; + } + + /** + * Set indicates which hour in UTC timezone a snapshot should be taken. + * + * @param hour the hour value to set + * @return the WeeklySchedule object itself. + */ + public WeeklySchedule withHour(Integer hour) { + this.hour = hour; + return this; + } + + /** + * Get indicates which minute snapshot should be taken. + * + * @return the minute value + */ + public Integer minute() { + return this.minute; + } + + /** + * Set indicates which minute snapshot should be taken. + * + * @param minute the minute value to set + * @return the WeeklySchedule object itself. + */ + public WeeklySchedule withMinute(Integer minute) { + this.minute = minute; + return this; + } + + /** + * Get resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set resource size in bytes, current storage usage for the volume in bytes. + * + * @param usedBytes the usedBytes value to set + * @return the WeeklySchedule object itself. + */ + public WeeklySchedule withUsedBytes(Long usedBytes) { + this.usedBytes = usedBytes; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsImpl.java new file mode 100644 index 0000000000000..679a89decb955 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsImpl.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.AccountBackups; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupsList; +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppAccountBackup; + +class AccountBackupsImpl extends WrapperImpl implements AccountBackups { + private final NetAppManager manager; + + AccountBackupsImpl(NetAppManager manager) { + super(manager.inner().accountBackups()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + private NetAppAccountBackupImpl wrapModel(BackupInner inner) { + return new NetAppAccountBackupImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + AccountBackupsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public BackupsList call(BackupsListInner inner) { + return new BackupsListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String backupName) { + AccountBackupsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, backupName) + .flatMap(new Func1>() { + @Override + public Observable call(BackupInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((NetAppAccountBackup)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String backupName) { + AccountBackupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, backupName).toCompletable(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsInner.java new file mode 100644 index 0000000000000..eb7459d86ffb7 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountBackupsInner.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +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 AccountBackups. + */ +public class AccountBackupsInner { + /** The Retrofit service to perform REST calls. */ + private AccountBackupsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of AccountBackupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountBackupsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(AccountBackupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AccountBackups to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountBackupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.AccountBackups list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.netapp.v2020_07_01.AccountBackups get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupName") String backupName, @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.netapp.v2020_07_01.AccountBackups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupName") String backupName, @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.netapp.v2020_07_01.AccountBackups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupName") String backupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Backups for a Netapp Account. + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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 BackupsListInner object if successful. + */ + public BackupsListInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List Backups for a Netapp Account. + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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 resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List Backups for a Netapp Account. + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupsListInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BackupsListInner>() { + @Override + public BackupsListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Backups for a Netapp Account. + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupsListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get Backup for a Netapp Account. + * Get Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @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 BackupInner object if successful. + */ + public BackupInner get(String resourceGroupName, String accountName, String backupName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, backupName).toBlocking().single().body(); + } + + /** + * Get Backup for a Netapp Account. + * Get Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String backupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, backupName), serviceCallback); + } + + /** + * Get Backup for a Netapp Account. + * Get Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String backupName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, backupName).map(new Func1, BackupInner>() { + @Override + public BackupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Backup for a Netapp Account. + * Get Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String backupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, backupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String backupName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, backupName).toBlocking().last().body(); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String backupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, backupName), serviceCallback); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String backupName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, backupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String backupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, backupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String backupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, backupName).toBlocking().single().body(); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String backupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, backupName), serviceCallback); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String backupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, backupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Backup for a Netapp Account. + * Delete Backup for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String backupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, backupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsImpl.java new file mode 100644 index 0000000000000..dc2204d19cac1 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.Accounts; +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AccountsImpl extends GroupableResourcesCoreImpl implements Accounts { + protected AccountsImpl(NetAppManager manager) { + super(manager.inner().accounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetAppAccount call(NetAppAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetAppAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetAppAccountImpl wrapModel(NetAppAccountInner inner) { + return new NetAppAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected NetAppAccountImpl wrapModel(String name) { + return new NetAppAccountImpl(name, new NetAppAccountInner(), this.manager()); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsInner.java new file mode 100644 index 0000000000000..5873dfd6fff07 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AccountsInner.java @@ -0,0 +1,805 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppAccountPatch; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.netapp.v2020_07_01.Accounts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountInner body, @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.netapp.v2020_07_01.Accounts beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountInner body, @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.netapp.v2020_07_01.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.netapp.v2020_07_01.Accounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.netapp.v2020_07_01.Accounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountPatch body, @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.netapp.v2020_07_01.Accounts beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountPatch body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetAppAccountInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetAppAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + 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> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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 NetAppAccountInner object if successful. + */ + public NetAppAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner createOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().last().body(); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner beginCreateOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().single().body(); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner update(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().last().body(); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner beginUpdate(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().single().body(); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AzureNetAppFilesManagementClientImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AzureNetAppFilesManagementClientImpl.java new file mode 100644 index 0000000000000..afa74b6defb53 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/AzureNetAppFilesManagementClientImpl.java @@ -0,0 +1,336 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AzureNetAppFilesManagementClientImpl class. + */ +public class AzureNetAppFilesManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AzureNetAppFilesManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Version of the API to be used with the client request. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 AzureNetAppFilesManagementClientImpl 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 AzureNetAppFilesManagementClientImpl 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 AzureNetAppFilesManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The NetAppResourcesInner object to access its operations. + */ + private NetAppResourcesInner netAppResources; + + /** + * Gets the NetAppResourcesInner object to access its operations. + * @return the NetAppResourcesInner object. + */ + public NetAppResourcesInner netAppResources() { + return this.netAppResources; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * The PoolsInner object to access its operations. + */ + private PoolsInner pools; + + /** + * Gets the PoolsInner object to access its operations. + * @return the PoolsInner object. + */ + public PoolsInner pools() { + return this.pools; + } + + /** + * The VolumesInner object to access its operations. + */ + private VolumesInner volumes; + + /** + * Gets the VolumesInner object to access its operations. + * @return the VolumesInner object. + */ + public VolumesInner volumes() { + return this.volumes; + } + + /** + * The SnapshotsInner object to access its operations. + */ + private SnapshotsInner snapshots; + + /** + * Gets the SnapshotsInner object to access its operations. + * @return the SnapshotsInner object. + */ + public SnapshotsInner snapshots() { + return this.snapshots; + } + + /** + * The SnapshotPoliciesInner object to access its operations. + */ + private SnapshotPoliciesInner snapshotPolicies; + + /** + * Gets the SnapshotPoliciesInner object to access its operations. + * @return the SnapshotPoliciesInner object. + */ + public SnapshotPoliciesInner snapshotPolicies() { + return this.snapshotPolicies; + } + + /** + * The AccountBackupsInner object to access its operations. + */ + private AccountBackupsInner accountBackups; + + /** + * Gets the AccountBackupsInner object to access its operations. + * @return the AccountBackupsInner object. + */ + public AccountBackupsInner accountBackups() { + return this.accountBackups; + } + + /** + * The BackupsInner object to access its operations. + */ + private BackupsInner backups; + + /** + * Gets the BackupsInner object to access its operations. + * @return the BackupsInner object. + */ + public BackupsInner backups() { + return this.backups; + } + + /** + * The BackupPoliciesInner object to access its operations. + */ + private BackupPoliciesInner backupPolicies; + + /** + * Gets the BackupPoliciesInner object to access its operations. + * @return the BackupPoliciesInner object. + */ + public BackupPoliciesInner backupPolicies() { + return this.backupPolicies; + } + + /** + * The VaultsInner object to access its operations. + */ + private VaultsInner vaults; + + /** + * Gets the VaultsInner object to access its operations. + * @return the VaultsInner object. + */ + public VaultsInner vaults() { + return this.vaults; + } + + /** + * Initializes an instance of AzureNetAppFilesManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public AzureNetAppFilesManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AzureNetAppFilesManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AzureNetAppFilesManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AzureNetAppFilesManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AzureNetAppFilesManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-06-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.netAppResources = new NetAppResourcesInner(restClient().retrofit(), this); + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.pools = new PoolsInner(restClient().retrofit(), this); + this.volumes = new VolumesInner(restClient().retrofit(), this); + this.snapshots = new SnapshotsInner(restClient().retrofit(), this); + this.snapshotPolicies = new SnapshotPoliciesInner(restClient().retrofit(), this); + this.accountBackups = new AccountBackupsInner(restClient().retrofit(), this); + this.backups = new BackupsInner(restClient().retrofit(), this); + this.backupPolicies = new BackupPoliciesInner(restClient().retrofit(), this); + this.vaults = new VaultsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AzureNetAppFilesManagementClient", "2020-06-01"); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupInner.java new file mode 100644 index 0000000000000..d8bece17d5142 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupInner.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Backup of a Volume. + */ +@JsonFlatten +public class BackupInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * backupId. + * UUID v4 used to identify the Backup. + */ + @JsonProperty(value = "properties.backupId", access = JsonProperty.Access.WRITE_ONLY) + private String backupId; + + /** + * name. + * The creation date of the backup. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Size of backup. + */ + @JsonProperty(value = "properties.size", access = JsonProperty.Access.WRITE_ONLY) + private Long size; + + /** + * Label for backup. + */ + @JsonProperty(value = "properties.label") + private String label; + + /** + * Type of backup adhoc or scheduled. + */ + @JsonProperty(value = "properties.backupType", access = JsonProperty.Access.WRITE_ONLY) + private String backupType; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the BackupInner object itself. + */ + public BackupInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get uUID v4 used to identify the Backup. + * + * @return the backupId value + */ + public String backupId() { + return this.backupId; + } + + /** + * Get the creation date of the backup. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get size of backup. + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Get label for backup. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label for backup. + * + * @param label the label value to set + * @return the BackupInner object itself. + */ + public BackupInner withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get type of backup adhoc or scheduled. + * + * @return the backupType value + */ + public String backupType() { + return this.backupType; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesImpl.java new file mode 100644 index 0000000000000..d1d591c37425e --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPolicy; + +class BackupPoliciesImpl extends WrapperImpl implements BackupPolicies { + private final NetAppManager manager; + + BackupPoliciesImpl(NetAppManager manager) { + super(manager.inner().backupPolicies()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public BackupPolicyImpl define(String name) { + return wrapModel(name); + } + + private BackupPolicyImpl wrapModel(BackupPolicyInner inner) { + return new BackupPolicyImpl(inner, manager()); + } + + private BackupPolicyImpl wrapModel(String name) { + return new BackupPolicyImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + BackupPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public BackupPolicy call(BackupPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String backupPolicyName) { + BackupPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, backupPolicyName) + .flatMap(new Func1>() { + @Override + public Observable call(BackupPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BackupPolicy)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String backupPolicyName) { + BackupPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, backupPolicyName).toCompletable(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesInner.java new file mode 100644 index 0000000000000..6d4d5667c7f39 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPoliciesInner.java @@ -0,0 +1,760 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPolicyPatch; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BackupPolicies. + */ +public class BackupPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private BackupPoliciesService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of BackupPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupPoliciesInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(BackupPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.BackupPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.netapp.v2020_07_01.BackupPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupPolicyName") String backupPolicyName, @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.netapp.v2020_07_01.BackupPolicies create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupPolicyName") String backupPolicyName, @Query("api-version") String apiVersion, @Body BackupPolicyInner body, @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.netapp.v2020_07_01.BackupPolicies beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupPolicyName") String backupPolicyName, @Query("api-version") String apiVersion, @Body BackupPolicyInner body, @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.netapp.v2020_07_01.BackupPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupPolicyName") String backupPolicyName, @Query("api-version") String apiVersion, @Body BackupPolicyPatch body, @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.netapp.v2020_07_01.BackupPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupPolicyName") String backupPolicyName, @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.netapp.v2020_07_01.BackupPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("backupPolicyName") String backupPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List backup policies. + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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<BackupPolicyInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List backup policies. + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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 resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List backup policies. + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupPolicyInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List backup policies. + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a backup Policy. + * Get a particular backup Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupPolicyInner object if successful. + */ + public BackupPolicyInner get(String resourceGroupName, String accountName, String backupPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName).toBlocking().single().body(); + } + + /** + * Get a backup Policy. + * Get a particular backup Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName), serviceCallback); + } + + /** + * Get a backup Policy. + * Get a particular backup Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String backupPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName).map(new Func1, BackupPolicyInner>() { + @Override + public BackupPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a backup Policy. + * Get a particular backup Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String backupPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, backupPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupPolicyInner object if successful. + */ + public BackupPolicyInner create(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + return createWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body).toBlocking().last().body(); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body), serviceCallback); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + return createWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body).map(new Func1, BackupPolicyInner>() { + @Override + public BackupPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, backupPolicyName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupPolicyInner object if successful. + */ + public BackupPolicyInner beginCreate(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body).toBlocking().single().body(); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body), serviceCallback); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body).map(new Func1, BackupPolicyInner>() { + @Override + public BackupPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a backup policy. + * Create a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, backupPolicyName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patch a backup policy. + * Patch a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupPolicyInner object if successful. + */ + public BackupPolicyInner update(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body).toBlocking().single().body(); + } + + /** + * Patch a backup policy. + * Patch a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body), serviceCallback); + } + + /** + * Patch a backup policy. + * Patch a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName, body).map(new Func1, BackupPolicyInner>() { + @Override + public BackupPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a backup policy. + * Patch a backup policy for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param body Backup policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupPolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, backupPolicyName, this.client.apiVersion(), body, 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); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String backupPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName).toBlocking().last().body(); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName), serviceCallback); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String backupPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String backupPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, backupPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String backupPolicyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName).toBlocking().single().body(); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String backupPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName), serviceCallback); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String backupPolicyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, backupPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a backup policy. + * Delete backup policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param backupPolicyName Backup policy Name which uniquely identify backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String backupPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (backupPolicyName == null) { + throw new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, backupPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyImpl.java new file mode 100644 index 0000000000000..efb56a0e5482f --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyImpl.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPolicyPatch; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumeBackups; +import java.util.Map; +import rx.functions.Func1; + +class BackupPolicyImpl extends CreatableUpdatableImpl implements BackupPolicy, BackupPolicy.Definition, BackupPolicy.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String backupPolicyName; + private BackupPolicyPatch updateParameter; + + BackupPolicyImpl(String name, NetAppManager manager) { + super(name, new BackupPolicyInner()); + this.manager = manager; + // Set resource name + this.backupPolicyName = name; + // + this.updateParameter = new BackupPolicyPatch(); + } + + BackupPolicyImpl(BackupPolicyInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.backupPolicyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.backupPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupPolicies"); + // + this.updateParameter = new BackupPolicyPatch(); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BackupPoliciesInner client = this.manager().inner().backupPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.backupPolicyName, this.inner()) + .map(new Func1() { + @Override + public BackupPolicyInner call(BackupPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BackupPoliciesInner client = this.manager().inner().backupPolicies(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.backupPolicyName, this.updateParameter) + .map(new Func1() { + @Override + public BackupPolicyInner call(BackupPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BackupPoliciesInner client = this.manager().inner().backupPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.backupPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new BackupPolicyPatch(); + } + + @Override + public Integer dailyBackupsToKeep() { + return this.inner().dailyBackupsToKeep(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Integer monthlyBackupsToKeep() { + return this.inner().monthlyBackupsToKeep(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String name1() { + return this.inner().name1(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public List volumeBackups() { + return this.inner().volumeBackups(); + } + + @Override + public Integer volumesAssigned() { + return this.inner().volumesAssigned(); + } + + @Override + public Integer weeklyBackupsToKeep() { + return this.inner().weeklyBackupsToKeep(); + } + + @Override + public Integer yearlyBackupsToKeep() { + return this.inner().yearlyBackupsToKeep(); + } + + @Override + public BackupPolicyImpl withExistingNetAppAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public BackupPolicyImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public BackupPolicyImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public BackupPolicyImpl withDailyBackupsToKeep(Integer dailyBackupsToKeep) { + if (isInCreateMode()) { + this.inner().withDailyBackupsToKeep(dailyBackupsToKeep); + } else { + this.updateParameter.withDailyBackupsToKeep(dailyBackupsToKeep); + } + return this; + } + + @Override + public BackupPolicyImpl withEnabled(Boolean enabled) { + if (isInCreateMode()) { + this.inner().withEnabled(enabled); + } else { + this.updateParameter.withEnabled(enabled); + } + return this; + } + + @Override + public BackupPolicyImpl withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep) { + if (isInCreateMode()) { + this.inner().withMonthlyBackupsToKeep(monthlyBackupsToKeep); + } else { + this.updateParameter.withMonthlyBackupsToKeep(monthlyBackupsToKeep); + } + return this; + } + + @Override + public BackupPolicyImpl withVolumeBackups(List volumeBackups) { + if (isInCreateMode()) { + this.inner().withVolumeBackups(volumeBackups); + } else { + this.updateParameter.withVolumeBackups(volumeBackups); + } + return this; + } + + @Override + public BackupPolicyImpl withVolumesAssigned(Integer volumesAssigned) { + if (isInCreateMode()) { + this.inner().withVolumesAssigned(volumesAssigned); + } else { + this.updateParameter.withVolumesAssigned(volumesAssigned); + } + return this; + } + + @Override + public BackupPolicyImpl withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep) { + if (isInCreateMode()) { + this.inner().withWeeklyBackupsToKeep(weeklyBackupsToKeep); + } else { + this.updateParameter.withWeeklyBackupsToKeep(weeklyBackupsToKeep); + } + return this; + } + + @Override + public BackupPolicyImpl withYearlyBackupsToKeep(Integer yearlyBackupsToKeep) { + if (isInCreateMode()) { + this.inner().withYearlyBackupsToKeep(yearlyBackupsToKeep); + } else { + this.updateParameter.withYearlyBackupsToKeep(yearlyBackupsToKeep); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyInner.java new file mode 100644 index 0000000000000..f291dabb8788d --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupPolicyInner.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumeBackups; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Backup policy information. + */ +@JsonFlatten +public class BackupPolicyInner extends Resource { + /** + * Name of backup policy. + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String name1; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Daily backups count to keep. + */ + @JsonProperty(value = "properties.dailyBackupsToKeep") + private Integer dailyBackupsToKeep; + + /** + * Weekly backups count to keep. + */ + @JsonProperty(value = "properties.weeklyBackupsToKeep") + private Integer weeklyBackupsToKeep; + + /** + * Monthly backups count to keep. + */ + @JsonProperty(value = "properties.monthlyBackupsToKeep") + private Integer monthlyBackupsToKeep; + + /** + * Yearly backups count to keep. + */ + @JsonProperty(value = "properties.yearlyBackupsToKeep") + private Integer yearlyBackupsToKeep; + + /** + * Volumes using current backup policy. + */ + @JsonProperty(value = "properties.volumesAssigned") + private Integer volumesAssigned; + + /** + * The property to decide policy is enabled or not. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * A list of volumes assigned to this policy. + */ + @JsonProperty(value = "properties.volumeBackups") + private List volumeBackups; + + /** + * Get name of backup policy. + * + * @return the name1 value + */ + public String name1() { + return this.name1; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get daily backups count to keep. + * + * @return the dailyBackupsToKeep value + */ + public Integer dailyBackupsToKeep() { + return this.dailyBackupsToKeep; + } + + /** + * Set daily backups count to keep. + * + * @param dailyBackupsToKeep the dailyBackupsToKeep value to set + * @return the BackupPolicyInner object itself. + */ + public BackupPolicyInner withDailyBackupsToKeep(Integer dailyBackupsToKeep) { + this.dailyBackupsToKeep = dailyBackupsToKeep; + return this; + } + + /** + * Get weekly backups count to keep. + * + * @return the weeklyBackupsToKeep value + */ + public Integer weeklyBackupsToKeep() { + return this.weeklyBackupsToKeep; + } + + /** + * Set weekly backups count to keep. + * + * @param weeklyBackupsToKeep the weeklyBackupsToKeep value to set + * @return the BackupPolicyInner object itself. + */ + public BackupPolicyInner withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep) { + this.weeklyBackupsToKeep = weeklyBackupsToKeep; + return this; + } + + /** + * Get monthly backups count to keep. + * + * @return the monthlyBackupsToKeep value + */ + public Integer monthlyBackupsToKeep() { + return this.monthlyBackupsToKeep; + } + + /** + * Set monthly backups count to keep. + * + * @param monthlyBackupsToKeep the monthlyBackupsToKeep value to set + * @return the BackupPolicyInner object itself. + */ + public BackupPolicyInner withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep) { + this.monthlyBackupsToKeep = monthlyBackupsToKeep; + return this; + } + + /** + * Get yearly backups count to keep. + * + * @return the yearlyBackupsToKeep value + */ + public Integer yearlyBackupsToKeep() { + return this.yearlyBackupsToKeep; + } + + /** + * Set yearly backups count to keep. + * + * @param yearlyBackupsToKeep the yearlyBackupsToKeep value to set + * @return the BackupPolicyInner object itself. + */ + public BackupPolicyInner withYearlyBackupsToKeep(Integer yearlyBackupsToKeep) { + this.yearlyBackupsToKeep = yearlyBackupsToKeep; + return this; + } + + /** + * Get volumes using current backup policy. + * + * @return the volumesAssigned value + */ + public Integer volumesAssigned() { + return this.volumesAssigned; + } + + /** + * Set volumes using current backup policy. + * + * @param volumesAssigned the volumesAssigned value to set + * @return the BackupPolicyInner object itself. + */ + public BackupPolicyInner withVolumesAssigned(Integer volumesAssigned) { + this.volumesAssigned = volumesAssigned; + return this; + } + + /** + * Get the property to decide policy is enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the property to decide policy is enabled or not. + * + * @param enabled the enabled value to set + * @return the BackupPolicyInner object itself. + */ + public BackupPolicyInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get a list of volumes assigned to this policy. + * + * @return the volumeBackups value + */ + public List volumeBackups() { + return this.volumeBackups; + } + + /** + * Set a list of volumes assigned to this policy. + * + * @param volumeBackups the volumeBackups value to set + * @return the BackupPolicyInner object itself. + */ + public BackupPolicyInner withVolumeBackups(List volumeBackups) { + this.volumeBackups = volumeBackups; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsImpl.java new file mode 100644 index 0000000000000..ea6bc77ba794f --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.Backups; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.CapacityPoolNetAppAccountBackup; + +class BackupsImpl extends WrapperImpl implements Backups { + private final NetAppManager manager; + + BackupsImpl(NetAppManager manager) { + super(manager.inner().backups()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public CapacityPoolNetAppAccountBackupImpl define(String name) { + return wrapModel(name); + } + + private CapacityPoolNetAppAccountBackupImpl wrapModel(BackupInner inner) { + return new CapacityPoolNetAppAccountBackupImpl(inner, manager()); + } + + private CapacityPoolNetAppAccountBackupImpl wrapModel(String name) { + return new CapacityPoolNetAppAccountBackupImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + BackupsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, poolName, volumeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CapacityPoolNetAppAccountBackup call(BackupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + BackupsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName, volumeName, backupName) + .flatMap(new Func1>() { + @Override + public Observable call(BackupInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CapacityPoolNetAppAccountBackup)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + BackupsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName).toCompletable(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsInner.java new file mode 100644 index 0000000000000..e08d405690739 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsInner.java @@ -0,0 +1,960 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPatch; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Backups. + */ +public class BackupsInner { + /** The Retrofit service to perform REST calls. */ + private BackupsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of BackupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(BackupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Backups to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Backups list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Backups get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("backupName") String backupName, @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.netapp.v2020_07_01.Backups create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("backupName") String backupName, @Query("api-version") String apiVersion, @Body BackupInner body, @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.netapp.v2020_07_01.Backups beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("backupName") String backupName, @Query("api-version") String apiVersion, @Body BackupInner body, @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.netapp.v2020_07_01.Backups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("backupName") String backupName, @Query("api-version") String apiVersion, @Body BackupPatch body, @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.netapp.v2020_07_01.Backups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("backupName") String backupName, @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.netapp.v2020_07_01.Backups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("backupName") String backupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Backups. + * List all backups for a volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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<BackupInner> object if successful. + */ + public List list(String resourceGroupName, String accountName, String poolName, String volumeName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * List Backups. + * List all backups for a volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * List Backups. + * List all backups for a volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Backups. + * List all backups for a volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BackupInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a backup. + * Get a particular backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @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 BackupInner object if successful. + */ + public BackupInner get(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).toBlocking().single().body(); + } + + /** + * Get a backup. + * Get a particular backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName), serviceCallback); + } + + /** + * Get a backup. + * Get a particular backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).map(new Func1, BackupInner>() { + @Override + public BackupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a backup. + * Get a particular backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, backupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupInner object if successful. + */ + public BackupInner create(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).toBlocking().last().body(); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body), serviceCallback); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).map(new Func1, BackupInner>() { + @Override + public BackupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, backupName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupInner object if successful. + */ + public BackupInner beginCreate(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).toBlocking().single().body(); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body), serviceCallback); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).map(new Func1, BackupInner>() { + @Override + public BackupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a backup. + * Create a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, backupName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @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 BackupInner object if successful. + */ + public BackupInner update(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).toBlocking().single().body(); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName), serviceCallback); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).map(new Func1, BackupInner>() { + @Override + public BackupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final BackupPatch body = null; + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, backupName, this.client.apiVersion(), body, 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); + } + } + }); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BackupInner object if successful. + */ + public BackupInner update(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).toBlocking().single().body(); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body), serviceCallback); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).map(new Func1, BackupInner>() { + @Override + public BackupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a backup. + * Patch a backup for the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param body Backup object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BackupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, BackupPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, backupName, this.client.apiVersion(), body, 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); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).toBlocking().last().body(); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName), serviceCallback); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, backupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).toBlocking().single().body(); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName), serviceCallback); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete backup. + * Delete a backup of the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param backupName The name of the backup + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (backupName == null) { + throw new IllegalArgumentException("Parameter backupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, backupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListImpl.java new file mode 100644 index 0000000000000..3813ada110f27 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.BackupsList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class BackupsListImpl extends WrapperImpl implements BackupsList { + private final NetAppManager manager; + BackupsListImpl(BackupsListInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListInner.java new file mode 100644 index 0000000000000..9398f8caf7688 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/BackupsListInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of Backups. + */ +public class BackupsListInner { + /** + * A list of Backups. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get a list of Backups. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of Backups. + * + * @param value the value value to set + * @return the BackupsListInner object itself. + */ + public BackupsListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolImpl.java new file mode 100644 index 0000000000000..25d3cd2e106f6 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolImpl.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.CapacityPool; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.CapacityPoolPatch; +import com.microsoft.azure.management.netapp.v2020_07_01.ServiceLevel; +import com.microsoft.azure.management.netapp.v2020_07_01.QosType; +import java.util.Map; +import rx.functions.Func1; + +class CapacityPoolImpl extends CreatableUpdatableImpl implements CapacityPool, CapacityPool.Definition, CapacityPool.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private CapacityPoolPatch updateParameter; + + CapacityPoolImpl(String name, NetAppManager manager) { + super(name, new CapacityPoolInner()); + this.manager = manager; + // Set resource name + this.poolName = name; + // + this.updateParameter = new CapacityPoolPatch(); + } + + CapacityPoolImpl(CapacityPoolInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.poolName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "capacityPools"); + // + this.updateParameter = new CapacityPoolPatch(); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.poolName, this.inner()) + .map(new Func1() { + @Override + public CapacityPoolInner call(CapacityPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.updateParameter) + .map(new Func1() { + @Override + public CapacityPoolInner call(CapacityPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new CapacityPoolPatch(); + } + + @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 String poolId() { + return this.inner().poolId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public QosType qosType() { + return this.inner().qosType(); + } + + @Override + public ServiceLevel serviceLevel() { + return this.inner().serviceLevel(); + } + + @Override + public long size() { + return this.inner().size(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Double totalThroughputMibps() { + return this.inner().totalThroughputMibps(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Double utilizedThroughputMibps() { + return this.inner().utilizedThroughputMibps(); + } + + @Override + public CapacityPoolImpl withExistingNetAppAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public CapacityPoolImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public CapacityPoolImpl withServiceLevel(ServiceLevel serviceLevel) { + this.inner().withServiceLevel(serviceLevel); + return this; + } + + @Override + public CapacityPoolImpl withSize(long size) { + this.inner().withSize(size); + return this; + } + + @Override + public CapacityPoolImpl withSize(Long size) { + this.updateParameter.withSize(size); + return this; + } + + @Override + public CapacityPoolImpl withQosType(QosType qosType) { + if (isInCreateMode()) { + this.inner().withQosType(qosType); + } else { + this.updateParameter.withQosType(qosType); + } + return this; + } + + @Override + public CapacityPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolInner.java new file mode 100644 index 0000000000000..941ed781a2b60 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolInner.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.ServiceLevel; +import com.microsoft.azure.management.netapp.v2020_07_01.QosType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Capacity pool resource. + */ +@JsonFlatten +public class CapacityPoolInner extends Resource { + /** + * poolId. + * UUID v4 used to identify the Pool. + */ + @JsonProperty(value = "properties.poolId", access = JsonProperty.Access.WRITE_ONLY) + private String poolId; + + /** + * size. + * Provisioned size of the pool (in bytes). Allowed values are in 4TiB + * chunks (value must be multiply of 4398046511104). + */ + @JsonProperty(value = "properties.size", required = true) + private long size; + + /** + * serviceLevel. + * The service level of the file system. Possible values include: + * 'Standard', 'Premium', 'Ultra'. + */ + @JsonProperty(value = "properties.serviceLevel", required = true) + private ServiceLevel serviceLevel; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Total throughput of pool in Mibps. + */ + @JsonProperty(value = "properties.totalThroughputMibps", access = JsonProperty.Access.WRITE_ONLY) + private Double totalThroughputMibps; + + /** + * Utilized throughput of pool in Mibps. + */ + @JsonProperty(value = "properties.utilizedThroughputMibps", access = JsonProperty.Access.WRITE_ONLY) + private Double utilizedThroughputMibps; + + /** + * qosType. + * The qos type of the pool. Possible values include: 'Auto', 'Manual'. + */ + @JsonProperty(value = "properties.qosType") + private QosType qosType; + + /** + * Get uUID v4 used to identify the Pool. + * + * @return the poolId value + */ + public String poolId() { + return this.poolId; + } + + /** + * Get provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @return the size value + */ + public long size() { + return this.size; + } + + /** + * Set provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @param size the size value to set + * @return the CapacityPoolInner object itself. + */ + public CapacityPoolInner withSize(long size) { + this.size = size; + return this; + } + + /** + * Get the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @return the serviceLevel value + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @param serviceLevel the serviceLevel value to set + * @return the CapacityPoolInner object itself. + */ + public CapacityPoolInner withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get total throughput of pool in Mibps. + * + * @return the totalThroughputMibps value + */ + public Double totalThroughputMibps() { + return this.totalThroughputMibps; + } + + /** + * Get utilized throughput of pool in Mibps. + * + * @return the utilizedThroughputMibps value + */ + public Double utilizedThroughputMibps() { + return this.utilizedThroughputMibps; + } + + /** + * Get the qos type of the pool. Possible values include: 'Auto', 'Manual'. + * + * @return the qosType value + */ + public QosType qosType() { + return this.qosType; + } + + /** + * Set the qos type of the pool. Possible values include: 'Auto', 'Manual'. + * + * @param qosType the qosType value to set + * @return the CapacityPoolInner object itself. + */ + public CapacityPoolInner withQosType(QosType qosType) { + this.qosType = qosType; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolNetAppAccountBackupImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolNetAppAccountBackupImpl.java new file mode 100644 index 0000000000000..844ec4b3b4a8d --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CapacityPoolNetAppAccountBackupImpl.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.CapacityPoolNetAppAccountBackup; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPatch; +import java.util.Map; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class CapacityPoolNetAppAccountBackupImpl extends CreatableUpdatableImpl implements CapacityPoolNetAppAccountBackup, CapacityPoolNetAppAccountBackup.Definition, CapacityPoolNetAppAccountBackup.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private String volumeName; + private String backupName; + private BackupPatch updateParameter; + + CapacityPoolNetAppAccountBackupImpl(String name, NetAppManager manager) { + super(name, new BackupInner()); + this.manager = manager; + // Set resource name + this.backupName = name; + // + this.updateParameter = new BackupPatch(); + } + + CapacityPoolNetAppAccountBackupImpl(BackupInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.backupName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "capacityPools"); + this.volumeName = IdParsingUtils.getValueFromIdByName(inner.id(), "volumes"); + this.backupName = IdParsingUtils.getValueFromIdByName(inner.id(), "backups"); + // + this.updateParameter = new BackupPatch(); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BackupsInner client = this.manager().inner().backups(); + return client.createAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.backupName, this.inner()) + .map(new Func1() { + @Override + public BackupInner call(BackupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BackupsInner client = this.manager().inner().backups(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.backupName, this.updateParameter) + .map(new Func1() { + @Override + public BackupInner call(BackupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BackupsInner client = this.manager().inner().backups(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.backupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new BackupPatch(); + } + + @Override + public String backupId() { + return this.inner().backupId(); + } + + @Override + public String backupType() { + return this.inner().backupType(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String label() { + return this.inner().label(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Long size() { + return this.inner().size(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CapacityPoolNetAppAccountBackupImpl withExistingVolume(String resourceGroupName, String accountName, String poolName, String volumeName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.poolName = poolName; + this.volumeName = volumeName; + return this; + } + + @Override + public CapacityPoolNetAppAccountBackupImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public CapacityPoolNetAppAccountBackupImpl withTags(Map tags) { + this.updateParameter.withTags(tags); + return this; + } + + @Override + public CapacityPoolNetAppAccountBackupImpl withLabel(String label) { + if (isInCreateMode()) { + this.inner().withLabel(label); + } else { + this.updateParameter.withLabel(label); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..aad2455ff6e1a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseImpl.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.CheckAvailabilityResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.InAvailabilityReasonType; + +class CheckAvailabilityResponseImpl extends WrapperImpl implements CheckAvailabilityResponse { + private final NetAppManager manager; + CheckAvailabilityResponseImpl(CheckAvailabilityResponseInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Boolean isAvailable() { + return this.inner().isAvailable(); + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public InAvailabilityReasonType reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseInner.java new file mode 100644 index 0000000000000..d65df57df614c --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/CheckAvailabilityResponseInner.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.InAvailabilityReasonType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information regarding availability of a resource. + */ +public class CheckAvailabilityResponseInner { + /** + * <code>true</code> indicates name is valid and available. + * <code>false</code> indicates the name is invalid, + * unavailable, or both. + */ + @JsonProperty(value = "isAvailable") + private Boolean isAvailable; + + /** + * <code>Invalid</code> indicates the name provided does not + * match Azure App Service naming requirements. + * <code>AlreadyExists</code> indicates that the name is + * already in use and is therefore unavailable. Possible values include: + * 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason") + private InAvailabilityReasonType reason; + + /** + * If reason == invalid, provide the user with the reason why the given + * name is invalid, and provide the resource naming requirements so that + * the user can select a valid name. If reason == AlreadyExists, explain + * that resource name is already in use, and direct them to select a + * different name. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. + * + * @return the isAvailable value + */ + public Boolean isAvailable() { + return this.isAvailable; + } + + /** + * Set <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. + * + * @param isAvailable the isAvailable value to set + * @return the CheckAvailabilityResponseInner object itself. + */ + public CheckAvailabilityResponseInner withIsAvailable(Boolean isAvailable) { + this.isAvailable = isAvailable; + return this; + } + + /** + * Get <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public InAvailabilityReasonType reason() { + return this.reason; + } + + /** + * Set <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @param reason the reason value to set + * @return the CheckAvailabilityResponseInner object itself. + */ + public CheckAvailabilityResponseInner withReason(InAvailabilityReasonType reason) { + this.reason = reason; + return this; + } + + /** + * Get if reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + * + * @param message the message value to set + * @return the CheckAvailabilityResponseInner object itself. + */ + public CheckAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/IdParsingUtils.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..189f8c2135d07 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountBackupImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountBackupImpl.java new file mode 100644 index 0000000000000..d2ed77136b014 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountBackupImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppAccountBackup; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class NetAppAccountBackupImpl extends IndexableRefreshableWrapperImpl implements NetAppAccountBackup { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String backupName; + + NetAppAccountBackupImpl(BackupInner inner, NetAppManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.backupName = IdParsingUtils.getValueFromIdByName(inner.id(), "accountBackups"); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + AccountBackupsInner client = this.manager().inner().accountBackups(); + return client.getAsync(this.resourceGroupName, this.accountName, this.backupName); + } + + + + @Override + public String backupId() { + return this.inner().backupId(); + } + + @Override + public String backupType() { + return this.inner().backupType(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String label() { + return this.inner().label(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Long size() { + return this.inner().size(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountImpl.java new file mode 100644 index 0000000000000..d4936a21a43d8 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountImpl.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppAccount; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppAccountPatch; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.ActiveDirectory; +import rx.functions.Func1; + +class NetAppAccountImpl extends GroupableResourceCoreImpl implements NetAppAccount, NetAppAccount.Definition, NetAppAccount.Update { + private NetAppAccountPatch updateParameter; + NetAppAccountImpl(String name, NetAppAccountInner inner, NetAppManager manager) { + super(name, inner, manager); + this.updateParameter = new NetAppAccountPatch(); + } + + @Override + public Observable createResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public NetAppAccountInner call(NetAppAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public NetAppAccountInner call(NetAppAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new NetAppAccountPatch(); + } + + @Override + public List activeDirectories() { + return this.inner().activeDirectories(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public NetAppAccountImpl withActiveDirectories(List activeDirectories) { + if (isInCreateMode()) { + this.inner().withActiveDirectories(activeDirectories); + } else { + this.updateParameter.withActiveDirectories(activeDirectories); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountInner.java new file mode 100644 index 0000000000000..dbf9d05fdd347 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppAccountInner.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.ActiveDirectory; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * NetApp account resource. + */ +@JsonFlatten +public class NetAppAccountInner extends Resource { + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Active Directories. + */ + @JsonProperty(value = "properties.activeDirectories") + private List activeDirectories; + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get active Directories. + * + * @return the activeDirectories value + */ + public List activeDirectories() { + return this.activeDirectories; + } + + /** + * Set active Directories. + * + * @param activeDirectories the activeDirectories value to set + * @return the NetAppAccountInner object itself. + */ + public NetAppAccountInner withActiveDirectories(List activeDirectories) { + this.activeDirectories = activeDirectories; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppManager.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppManager.java new file mode 100644 index 0000000000000..f5c3a61069928 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppManager.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.netapp.v2020_07_01.Operations; +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppResources; +import com.microsoft.azure.management.netapp.v2020_07_01.Accounts; +import com.microsoft.azure.management.netapp.v2020_07_01.Pools; +import com.microsoft.azure.management.netapp.v2020_07_01.Volumes; +import com.microsoft.azure.management.netapp.v2020_07_01.Snapshots; +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicies; +import com.microsoft.azure.management.netapp.v2020_07_01.AccountBackups; +import com.microsoft.azure.management.netapp.v2020_07_01.Backups; +import com.microsoft.azure.management.netapp.v2020_07_01.BackupPolicies; +import com.microsoft.azure.management.netapp.v2020_07_01.Vaults; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NetApp resource management. + */ +public final class NetAppManager extends ManagerCore { + private Operations operations; + private NetAppResources netAppResources; + private Accounts accounts; + private Pools pools; + private Volumes volumes; + private Snapshots snapshots; + private SnapshotPolicies snapshotPolicies; + private AccountBackups accountBackups; + private Backups backups; + private BackupPolicies backupPolicies; + private Vaults vaults; + /** + * Get a Configurable instance that can be used to create NetAppManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetAppManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetAppManager that exposes NetApp resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetAppManager + */ + public static NetAppManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetAppManager(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 NetAppManager that exposes NetApp resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetAppManager + */ + public static NetAppManager authenticate(RestClient restClient, String subscriptionId) { + return new NetAppManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetAppManager that exposes NetApp management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NetApp management API entry points that work across subscriptions + */ + NetAppManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage NetAppResources. + */ + public NetAppResources netAppResources() { + if (this.netAppResources == null) { + this.netAppResources = new NetAppResourcesImpl(this); + } + return this.netAppResources; + } + + /** + * @return Entry point to manage Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(this); + } + return this.accounts; + } + + /** + * @return Entry point to manage Pools. + */ + public Pools pools() { + if (this.pools == null) { + this.pools = new PoolsImpl(this); + } + return this.pools; + } + + /** + * @return Entry point to manage Volumes. + */ + public Volumes volumes() { + if (this.volumes == null) { + this.volumes = new VolumesImpl(this); + } + return this.volumes; + } + + /** + * @return Entry point to manage Snapshots. + */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(this); + } + return this.snapshots; + } + + /** + * @return Entry point to manage SnapshotPolicies. + */ + public SnapshotPolicies snapshotPolicies() { + if (this.snapshotPolicies == null) { + this.snapshotPolicies = new SnapshotPoliciesImpl(this); + } + return this.snapshotPolicies; + } + + /** + * @return Entry point to manage AccountBackups. + */ + public AccountBackups accountBackups() { + if (this.accountBackups == null) { + this.accountBackups = new AccountBackupsImpl(this); + } + return this.accountBackups; + } + + /** + * @return Entry point to manage Backups. + */ + public Backups backups() { + if (this.backups == null) { + this.backups = new BackupsImpl(this); + } + return this.backups; + } + + /** + * @return Entry point to manage BackupPolicies. + */ + public BackupPolicies backupPolicies() { + if (this.backupPolicies == null) { + this.backupPolicies = new BackupPoliciesImpl(this); + } + return this.backupPolicies; + } + + /** + * @return Entry point to manage Vaults. + */ + public Vaults vaults() { + if (this.vaults == null) { + this.vaults = new VaultsImpl(this); + } + return this.vaults; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetAppManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetAppManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetAppManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AzureNetAppFilesManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesImpl.java new file mode 100644 index 0000000000000..21af6def34140 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesImpl.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. + * abc + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.NetAppResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.CheckAvailabilityResponse; +import com.microsoft.azure.management.netapp.v2020_07_01.CheckNameResourceTypes; +import com.microsoft.azure.management.netapp.v2020_07_01.CheckQuotaNameResourceTypes; + +class NetAppResourcesImpl extends WrapperImpl implements NetAppResources { + private final NetAppManager manager; + + NetAppResourcesImpl(NetAppManager manager) { + super(manager.inner().netAppResources()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + NetAppResourcesInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, name, type, resourceGroup) + .map(new Func1() { + @Override + public CheckAvailabilityResponse call(CheckAvailabilityResponseInner inner) { + return new CheckAvailabilityResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + NetAppResourcesInner client = this.inner(); + return client.checkFilePathAvailabilityAsync(location, name, type, resourceGroup) + .map(new Func1() { + @Override + public CheckAvailabilityResponse call(CheckAvailabilityResponseInner inner) { + return new CheckAvailabilityResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkQuotaAvailabilityAsync(String location, String name, CheckQuotaNameResourceTypes type, String resourceGroup) { + NetAppResourcesInner client = this.inner(); + return client.checkQuotaAvailabilityAsync(location, name, type, resourceGroup) + .map(new Func1() { + @Override + public CheckAvailabilityResponse call(CheckAvailabilityResponseInner inner) { + return new CheckAvailabilityResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesInner.java new file mode 100644 index 0000000000000..bd731e4a33cc3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/NetAppResourcesInner.java @@ -0,0 +1,397 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_07_01.CheckNameResourceTypes; +import com.microsoft.azure.management.netapp.v2020_07_01.CheckQuotaNameResourceTypes; +import com.microsoft.azure.management.netapp.v2020_07_01.QuotaAvailabilityRequest; +import com.microsoft.azure.management.netapp.v2020_07_01.ResourceNameAvailabilityRequest; +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.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 NetAppResources. + */ +public class NetAppResourcesInner { + /** The Retrofit service to perform REST calls. */ + private NetAppResourcesService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of NetAppResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetAppResourcesInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(NetAppResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetAppResources to be + * used by Retrofit to perform actually REST calls. + */ + interface NetAppResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.NetAppResources checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceNameAvailabilityRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.NetAppResources checkFilePathAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability") + Observable> checkFilePathAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceNameAvailabilityRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.NetAppResources checkQuotaAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability") + Observable> checkQuotaAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QuotaAvailabilityRequest body, @Header("User-Agent") String userAgent); + + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResponseInner object if successful. + */ + public CheckAvailabilityResponseInner checkNameAvailability(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkNameAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).toBlocking().single().body(); + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup), serviceCallback); + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResponseInner object + */ + public Observable checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkNameAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).map(new Func1, CheckAvailabilityResponseInner>() { + @Override + public CheckAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResponseInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + ResourceNameAvailabilityRequest body = new ResourceNameAvailabilityRequest(); + body.withName(name); + body.withType(type); + body.withResourceGroup(resourceGroup); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(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); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResponseInner object if successful. + */ + public CheckAvailabilityResponseInner checkFilePathAvailability(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkFilePathAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).toBlocking().single().body(); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkFilePathAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup), serviceCallback); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResponseInner object + */ + public Observable checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkFilePathAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).map(new Func1, CheckAvailabilityResponseInner>() { + @Override + public CheckAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResponseInner object + */ + public Observable> checkFilePathAvailabilityWithServiceResponseAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + ResourceNameAvailabilityRequest body = new ResourceNameAvailabilityRequest(); + body.withName(name); + body.withType(type); + body.withResourceGroup(resourceGroup); + return service.checkFilePathAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkFilePathAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkFilePathAvailabilityDelegate(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); + } + + /** + * Check quota availability. + * Check if a quota is available. + * + * @param location The location + * @param name Name of the resource to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckAvailabilityResponseInner object if successful. + */ + public CheckAvailabilityResponseInner checkQuotaAvailability(String location, String name, CheckQuotaNameResourceTypes type, String resourceGroup) { + return checkQuotaAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).toBlocking().single().body(); + } + + /** + * Check quota availability. + * Check if a quota is available. + * + * @param location The location + * @param name Name of the resource to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkQuotaAvailabilityAsync(String location, String name, CheckQuotaNameResourceTypes type, String resourceGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkQuotaAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup), serviceCallback); + } + + /** + * Check quota availability. + * Check if a quota is available. + * + * @param location The location + * @param name Name of the resource to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResponseInner object + */ + public Observable checkQuotaAvailabilityAsync(String location, String name, CheckQuotaNameResourceTypes type, String resourceGroup) { + return checkQuotaAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).map(new Func1, CheckAvailabilityResponseInner>() { + @Override + public CheckAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check quota availability. + * Check if a quota is available. + * + * @param location The location + * @param name Name of the resource to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckAvailabilityResponseInner object + */ + public Observable> checkQuotaAvailabilityWithServiceResponseAsync(String location, String name, CheckQuotaNameResourceTypes type, String resourceGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + QuotaAvailabilityRequest body = new QuotaAvailabilityRequest(); + body.withName(name); + body.withType(type); + body.withResourceGroup(resourceGroup); + return service.checkQuotaAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkQuotaAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkQuotaAvailabilityDelegate(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/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..d62d0e3209757 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.OperationDisplay; +import com.microsoft.azure.management.netapp.v2020_07_01.ServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final NetAppManager manager; + OperationImpl(OperationInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public ServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..05c861c10fc36 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationInner.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.OperationDisplay; +import com.microsoft.azure.management.netapp.v2020_07_01.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Microsoft.NetApp REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin of operations. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin of operations. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get one property of operation, include metric specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set one property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..ffdf9cc25c382 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NetAppManager manager; + + OperationsImpl(NetAppManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..12cfdb06dd1b5 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/OperationsInner.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl 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, AzureNetAppFilesManagementClientImpl 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.netapp.v2020_07_01.Operations list" }) + @GET("providers/Microsoft.NetApp/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API 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 List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws 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/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PageImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..cc441fd03c9ee --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsImpl.java new file mode 100644 index 0000000000000..8474d184768a5 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.Pools; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.CapacityPool; + +class PoolsImpl extends WrapperImpl implements Pools { + private final NetAppManager manager; + + PoolsImpl(NetAppManager manager) { + super(manager.inner().pools()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public CapacityPoolImpl define(String name) { + return wrapModel(name); + } + + private CapacityPoolImpl wrapModel(CapacityPoolInner inner) { + return new CapacityPoolImpl(inner, manager()); + } + + private CapacityPoolImpl wrapModel(String name) { + return new CapacityPoolImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + PoolsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CapacityPool call(CapacityPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName) + .flatMap(new Func1>() { + @Override + public Observable call(CapacityPoolInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CapacityPool)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName).toCompletable(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsInner.java new file mode 100644 index 0000000000000..96e3c7b5d1872 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/PoolsInner.java @@ -0,0 +1,852 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_07_01.CapacityPoolPatch; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Pools. + */ +public class PoolsInner { + /** The Retrofit service to perform REST calls. */ + private PoolsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of PoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PoolsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(PoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Pools to be + * used by Retrofit to perform actually REST calls. + */ + interface PoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Pools list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.netapp.v2020_07_01.Pools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.netapp.v2020_07_01.Pools createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolInner body, @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.netapp.v2020_07_01.Pools beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolInner body, @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.netapp.v2020_07_01.Pools update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolPatch body, @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.netapp.v2020_07_01.Pools beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolPatch body, @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.netapp.v2020_07_01.Pools delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.netapp.v2020_07_01.Pools beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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<CapacityPoolInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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 resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CapacityPoolInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CapacityPoolInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @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 CapacityPoolInner object if successful. + */ + public CapacityPoolInner get(String resourceGroupName, String accountName, String poolName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner createOrUpdate(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().last().body(); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner beginCreateOrUpdate(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().single().body(); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner update(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().last().body(); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner beginUpdate(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().single().body(); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String poolName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().last().body(); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String poolName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusImpl.java new file mode 100644 index 0000000000000..789cd8e552158 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.ReplicationStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.MirrorState; +import com.microsoft.azure.management.netapp.v2020_07_01.RelationshipStatus; + +class ReplicationStatusImpl extends WrapperImpl implements ReplicationStatus { + private final NetAppManager manager; + ReplicationStatusImpl(ReplicationStatusInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public String errorMessage() { + return this.inner().errorMessage(); + } + + @Override + public Boolean healthy() { + return this.inner().healthy(); + } + + @Override + public MirrorState mirrorState() { + return this.inner().mirrorState(); + } + + @Override + public RelationshipStatus relationshipStatus() { + return this.inner().relationshipStatus(); + } + + @Override + public String totalProgress() { + return this.inner().totalProgress(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusInner.java new file mode 100644 index 0000000000000..1e963b73e0379 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/ReplicationStatusInner.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.RelationshipStatus; +import com.microsoft.azure.management.netapp.v2020_07_01.MirrorState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Replication status. + */ +public class ReplicationStatusInner { + /** + * Replication health check. + */ + @JsonProperty(value = "healthy") + private Boolean healthy; + + /** + * Status of the mirror relationship. Possible values include: 'Idle', + * 'Transferring'. + */ + @JsonProperty(value = "relationshipStatus") + private RelationshipStatus relationshipStatus; + + /** + * The status of the replication. Possible values include: 'Uninitialized', + * 'Mirrored', 'Broken'. + */ + @JsonProperty(value = "mirrorState") + private MirrorState mirrorState; + + /** + * The progress of the replication. + */ + @JsonProperty(value = "totalProgress") + private String totalProgress; + + /** + * Displays error message if the replication is in an error state. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get replication health check. + * + * @return the healthy value + */ + public Boolean healthy() { + return this.healthy; + } + + /** + * Set replication health check. + * + * @param healthy the healthy value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withHealthy(Boolean healthy) { + this.healthy = healthy; + return this; + } + + /** + * Get status of the mirror relationship. Possible values include: 'Idle', 'Transferring'. + * + * @return the relationshipStatus value + */ + public RelationshipStatus relationshipStatus() { + return this.relationshipStatus; + } + + /** + * Set status of the mirror relationship. Possible values include: 'Idle', 'Transferring'. + * + * @param relationshipStatus the relationshipStatus value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withRelationshipStatus(RelationshipStatus relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get the status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'. + * + * @return the mirrorState value + */ + public MirrorState mirrorState() { + return this.mirrorState; + } + + /** + * Set the status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'. + * + * @param mirrorState the mirrorState value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withMirrorState(MirrorState mirrorState) { + this.mirrorState = mirrorState; + return this; + } + + /** + * Get the progress of the replication. + * + * @return the totalProgress value + */ + public String totalProgress() { + return this.totalProgress; + } + + /** + * Set the progress of the replication. + * + * @param totalProgress the totalProgress value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withTotalProgress(String totalProgress) { + this.totalProgress = totalProgress; + return this; + } + + /** + * Get displays error message if the replication is in an error state. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set displays error message if the replication is in an error state. + * + * @param errorMessage the errorMessage value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotImpl.java new file mode 100644 index 0000000000000..ee4fde600850a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotImpl.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.Snapshot; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class SnapshotImpl extends CreatableUpdatableImpl implements Snapshot, Snapshot.Definition, Snapshot.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private String volumeName; + private String snapshotName; + private String clocation; + private Object ubody; + + SnapshotImpl(String name, NetAppManager manager) { + super(name, new SnapshotInner()); + this.manager = manager; + // Set resource name + this.snapshotName = name; + // + } + + SnapshotImpl(SnapshotInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.snapshotName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "capacityPools"); + this.volumeName = IdParsingUtils.getValueFromIdByName(inner.id(), "volumes"); + this.snapshotName = IdParsingUtils.getValueFromIdByName(inner.id(), "snapshots"); + // + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SnapshotsInner client = this.manager().inner().snapshots(); + return client.createAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.snapshotName, this.clocation) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SnapshotsInner client = this.manager().inner().snapshots(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.snapshotName, this.ubody) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SnapshotsInner client = this.manager().inner().snapshots(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.snapshotName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @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 String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String snapshotId() { + return this.inner().snapshotId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SnapshotImpl withExistingVolume(String resourceGroupName, String accountName, String poolName, String volumeName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.poolName = poolName; + this.volumeName = volumeName; + return this; + } + + @Override + public SnapshotImpl withLocation(String location) { + this.clocation = location; + return this; + } + + @Override + public SnapshotImpl withBody(Object body) { + this.ubody = body; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotInner.java new file mode 100644 index 0000000000000..9071434773e00 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotInner.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Snapshot of a Volume. + */ +@JsonFlatten +public class SnapshotInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * snapshotId. + * UUID v4 used to identify the Snapshot. + */ + @JsonProperty(value = "properties.snapshotId", access = JsonProperty.Access.WRITE_ONLY) + private String snapshotId; + + /** + * name. + * The creation date of the snapshot. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the SnapshotInner object itself. + */ + public SnapshotInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get uUID v4 used to identify the Snapshot. + * + * @return the snapshotId value + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Get the creation date of the snapshot. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesImpl.java new file mode 100644 index 0000000000000..dc3df894135b4 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicy; +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicyVolumeList; + +class SnapshotPoliciesImpl extends WrapperImpl implements SnapshotPolicies { + private final NetAppManager manager; + + SnapshotPoliciesImpl(NetAppManager manager) { + super(manager.inner().snapshotPolicies()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public SnapshotPolicyImpl define(String name) { + return wrapModel(name); + } + + private SnapshotPolicyImpl wrapModel(SnapshotPolicyInner inner) { + return new SnapshotPolicyImpl(inner, manager()); + } + + private SnapshotPolicyImpl wrapModel(String name) { + return new SnapshotPolicyImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + SnapshotPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SnapshotPolicy call(SnapshotPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + SnapshotPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, snapshotPolicyName) + .flatMap(new Func1>() { + @Override + public Observable call(SnapshotPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SnapshotPolicy)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + SnapshotPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, snapshotPolicyName).toCompletable(); + } + + @Override + public Observable listVolumesAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + SnapshotPoliciesInner client = this.inner(); + return client.listVolumesAsync(resourceGroupName, accountName, snapshotPolicyName) + .map(new Func1() { + @Override + public SnapshotPolicyVolumeList call(SnapshotPolicyVolumeListInner inner) { + return new SnapshotPolicyVolumeListImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesInner.java new file mode 100644 index 0000000000000..f4d6e9dcdbbc6 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPoliciesInner.java @@ -0,0 +1,726 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicyPatch; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SnapshotPolicies. + */ +public class SnapshotPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private SnapshotPoliciesService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of SnapshotPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SnapshotPoliciesInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(SnapshotPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SnapshotPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface SnapshotPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.netapp.v2020_07_01.SnapshotPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("snapshotPolicyName") String snapshotPolicyName, @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.netapp.v2020_07_01.SnapshotPolicies create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("snapshotPolicyName") String snapshotPolicyName, @Body SnapshotPolicyInner body, @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.netapp.v2020_07_01.SnapshotPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("snapshotPolicyName") String snapshotPolicyName, @Body SnapshotPolicyPatch body, @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.netapp.v2020_07_01.SnapshotPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("snapshotPolicyName") String snapshotPolicyName, @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.netapp.v2020_07_01.SnapshotPolicies beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("snapshotPolicyName") String snapshotPolicyName, @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.netapp.v2020_07_01.SnapshotPolicies listVolumes" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/listVolumes") + Observable> listVolumes(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("snapshotPolicyName") String snapshotPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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<SnapshotPolicyInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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 resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SnapshotPolicyInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SnapshotPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a snapshot Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @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 SnapshotPolicyInner object if successful. + */ + public SnapshotPolicyInner get(String resourceGroupName, String accountName, String snapshotPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).toBlocking().single().body(); + } + + /** + * Get a snapshot Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String snapshotPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName), serviceCallback); + } + + /** + * Get a snapshot Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).map(new Func1, SnapshotPolicyInner>() { + @Override + public SnapshotPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a snapshot Policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (snapshotPolicyName == null) { + throw new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, snapshotPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotPolicyInner object if successful. + */ + public SnapshotPolicyInner create(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner body) { + return createWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body).toBlocking().last().body(); + } + + /** + * Create a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body), serviceCallback); + } + + /** + * Create a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner body) { + return createWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body).map(new Func1, SnapshotPolicyInner>() { + @Override + public SnapshotPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (snapshotPolicyName == null) { + throw new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, snapshotPolicyName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Patch a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotPolicyInner object if successful. + */ + public SnapshotPolicyInner update(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body).toBlocking().single().body(); + } + + /** + * Patch a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body), serviceCallback); + } + + /** + * Patch a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotPolicyInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body).map(new Func1, SnapshotPolicyInner>() { + @Override + public SnapshotPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch a snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param body Snapshot policy object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotPolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (snapshotPolicyName == null) { + throw new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, snapshotPolicyName, body, this.client.apiVersion(), 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); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String snapshotPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).toBlocking().last().body(); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String snapshotPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName), serviceCallback); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (snapshotPolicyName == null) { + throw new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, snapshotPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String snapshotPolicyName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).toBlocking().single().body(); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String snapshotPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName), serviceCallback); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (snapshotPolicyName == null) { + throw new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, snapshotPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get volumes associated with snapshot policy. + * Get volumes associated with snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @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 SnapshotPolicyVolumeListInner object if successful. + */ + public SnapshotPolicyVolumeListInner listVolumes(String resourceGroupName, String accountName, String snapshotPolicyName) { + return listVolumesWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).toBlocking().single().body(); + } + + /** + * Get volumes associated with snapshot policy. + * Get volumes associated with snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @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 listVolumesAsync(String resourceGroupName, String accountName, String snapshotPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listVolumesWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName), serviceCallback); + } + + /** + * Get volumes associated with snapshot policy. + * Get volumes associated with snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotPolicyVolumeListInner object + */ + public Observable listVolumesAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + return listVolumesWithServiceResponseAsync(resourceGroupName, accountName, snapshotPolicyName).map(new Func1, SnapshotPolicyVolumeListInner>() { + @Override + public SnapshotPolicyVolumeListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get volumes associated with snapshot policy. + * Get volumes associated with snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param snapshotPolicyName The name of the snapshot policy target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotPolicyVolumeListInner object + */ + public Observable> listVolumesWithServiceResponseAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (snapshotPolicyName == null) { + throw new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listVolumes(this.client.subscriptionId(), resourceGroupName, accountName, snapshotPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listVolumesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listVolumesDelegate(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/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyImpl.java new file mode 100644 index 0000000000000..fcdb868ef6ea9 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyImpl.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicyPatch; +import java.util.Map; +import com.microsoft.azure.management.netapp.v2020_07_01.HourlySchedule; +import com.microsoft.azure.management.netapp.v2020_07_01.DailySchedule; +import com.microsoft.azure.management.netapp.v2020_07_01.WeeklySchedule; +import com.microsoft.azure.management.netapp.v2020_07_01.MonthlySchedule; +import rx.functions.Func1; + +class SnapshotPolicyImpl extends CreatableUpdatableImpl implements SnapshotPolicy, SnapshotPolicy.Definition, SnapshotPolicy.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String snapshotPolicyName; + private SnapshotPolicyPatch updateParameter; + + SnapshotPolicyImpl(String name, NetAppManager manager) { + super(name, new SnapshotPolicyInner()); + this.manager = manager; + // Set resource name + this.snapshotPolicyName = name; + // + this.updateParameter = new SnapshotPolicyPatch(); + } + + SnapshotPolicyImpl(SnapshotPolicyInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.snapshotPolicyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.snapshotPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "snapshotPolicies"); + // + this.updateParameter = new SnapshotPolicyPatch(); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SnapshotPoliciesInner client = this.manager().inner().snapshotPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.snapshotPolicyName, this.inner()) + .map(new Func1() { + @Override + public SnapshotPolicyInner call(SnapshotPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SnapshotPoliciesInner client = this.manager().inner().snapshotPolicies(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.snapshotPolicyName, this.updateParameter) + .map(new Func1() { + @Override + public SnapshotPolicyInner call(SnapshotPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SnapshotPoliciesInner client = this.manager().inner().snapshotPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.snapshotPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new SnapshotPolicyPatch(); + } + + @Override + public DailySchedule dailySchedule() { + return this.inner().dailySchedule(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public HourlySchedule hourlySchedule() { + return this.inner().hourlySchedule(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MonthlySchedule monthlySchedule() { + return this.inner().monthlySchedule(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String name1() { + return this.inner().name1(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WeeklySchedule weeklySchedule() { + return this.inner().weeklySchedule(); + } + + @Override + public SnapshotPolicyImpl withExistingNetAppAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public SnapshotPolicyImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public SnapshotPolicyImpl withDailySchedule(DailySchedule dailySchedule) { + if (isInCreateMode()) { + this.inner().withDailySchedule(dailySchedule); + } else { + this.updateParameter.withDailySchedule(dailySchedule); + } + return this; + } + + @Override + public SnapshotPolicyImpl withEnabled(Boolean enabled) { + if (isInCreateMode()) { + this.inner().withEnabled(enabled); + } else { + this.updateParameter.withEnabled(enabled); + } + return this; + } + + @Override + public SnapshotPolicyImpl withHourlySchedule(HourlySchedule hourlySchedule) { + if (isInCreateMode()) { + this.inner().withHourlySchedule(hourlySchedule); + } else { + this.updateParameter.withHourlySchedule(hourlySchedule); + } + return this; + } + + @Override + public SnapshotPolicyImpl withMonthlySchedule(MonthlySchedule monthlySchedule) { + if (isInCreateMode()) { + this.inner().withMonthlySchedule(monthlySchedule); + } else { + this.updateParameter.withMonthlySchedule(monthlySchedule); + } + return this; + } + + @Override + public SnapshotPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public SnapshotPolicyImpl withWeeklySchedule(WeeklySchedule weeklySchedule) { + if (isInCreateMode()) { + this.inner().withWeeklySchedule(weeklySchedule); + } else { + this.updateParameter.withWeeklySchedule(weeklySchedule); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyInner.java new file mode 100644 index 0000000000000..c0e5ef4d4d6a4 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyInner.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.HourlySchedule; +import com.microsoft.azure.management.netapp.v2020_07_01.DailySchedule; +import com.microsoft.azure.management.netapp.v2020_07_01.WeeklySchedule; +import com.microsoft.azure.management.netapp.v2020_07_01.MonthlySchedule; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Snapshot policy information. + */ +@JsonFlatten +public class SnapshotPolicyInner extends Resource { + /** + * Snapshot policy name. + */ + @JsonProperty(value = "properties.name", access = JsonProperty.Access.WRITE_ONLY) + private String name1; + + /** + * hourlySchedule. + * Schedule for hourly snapshots. + */ + @JsonProperty(value = "properties.hourlySchedule") + private HourlySchedule hourlySchedule; + + /** + * dailySchedule. + * Schedule for daily snapshots. + */ + @JsonProperty(value = "properties.dailySchedule") + private DailySchedule dailySchedule; + + /** + * weeklySchedule. + * Schedule for weekly snapshots. + */ + @JsonProperty(value = "properties.weeklySchedule") + private WeeklySchedule weeklySchedule; + + /** + * monthlySchedule. + * Schedule for monthly snapshots. + */ + @JsonProperty(value = "properties.monthlySchedule") + private MonthlySchedule monthlySchedule; + + /** + * The property to decide policy is enabled or not. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get snapshot policy name. + * + * @return the name1 value + */ + public String name1() { + return this.name1; + } + + /** + * Get schedule for hourly snapshots. + * + * @return the hourlySchedule value + */ + public HourlySchedule hourlySchedule() { + return this.hourlySchedule; + } + + /** + * Set schedule for hourly snapshots. + * + * @param hourlySchedule the hourlySchedule value to set + * @return the SnapshotPolicyInner object itself. + */ + public SnapshotPolicyInner withHourlySchedule(HourlySchedule hourlySchedule) { + this.hourlySchedule = hourlySchedule; + return this; + } + + /** + * Get schedule for daily snapshots. + * + * @return the dailySchedule value + */ + public DailySchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set schedule for daily snapshots. + * + * @param dailySchedule the dailySchedule value to set + * @return the SnapshotPolicyInner object itself. + */ + public SnapshotPolicyInner withDailySchedule(DailySchedule dailySchedule) { + this.dailySchedule = dailySchedule; + return this; + } + + /** + * Get schedule for weekly snapshots. + * + * @return the weeklySchedule value + */ + public WeeklySchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set schedule for weekly snapshots. + * + * @param weeklySchedule the weeklySchedule value to set + * @return the SnapshotPolicyInner object itself. + */ + public SnapshotPolicyInner withWeeklySchedule(WeeklySchedule weeklySchedule) { + this.weeklySchedule = weeklySchedule; + return this; + } + + /** + * Get schedule for monthly snapshots. + * + * @return the monthlySchedule value + */ + public MonthlySchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set schedule for monthly snapshots. + * + * @param monthlySchedule the monthlySchedule value to set + * @return the SnapshotPolicyInner object itself. + */ + public SnapshotPolicyInner withMonthlySchedule(MonthlySchedule monthlySchedule) { + this.monthlySchedule = monthlySchedule; + return this; + } + + /** + * Get the property to decide policy is enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the property to decide policy is enabled or not. + * + * @param enabled the enabled value to set + * @return the SnapshotPolicyInner object itself. + */ + public SnapshotPolicyInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListImpl.java new file mode 100644 index 0000000000000..c9a6d65c5c52a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.SnapshotPolicyVolumeList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class SnapshotPolicyVolumeListImpl extends WrapperImpl implements SnapshotPolicyVolumeList { + private final NetAppManager manager; + SnapshotPolicyVolumeListImpl(SnapshotPolicyVolumeListInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListInner.java new file mode 100644 index 0000000000000..50bf2b2902e18 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotPolicyVolumeListInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of volume resources associated with snapshot policy. + */ +public class SnapshotPolicyVolumeListInner { + /** + * List of volumes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of volumes. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of volumes. + * + * @param value the value value to set + * @return the SnapshotPolicyVolumeListInner object itself. + */ + public SnapshotPolicyVolumeListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsImpl.java new file mode 100644 index 0000000000000..2eda7ae57c3ee --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.Snapshots; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.Snapshot; + +class SnapshotsImpl extends WrapperImpl implements Snapshots { + private final NetAppManager manager; + + SnapshotsImpl(NetAppManager manager) { + super(manager.inner().snapshots()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public SnapshotImpl define(String name) { + return wrapModel(name); + } + + private SnapshotImpl wrapModel(SnapshotInner inner) { + return new SnapshotImpl(inner, manager()); + } + + private SnapshotImpl wrapModel(String name) { + return new SnapshotImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + SnapshotsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, poolName, volumeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Snapshot call(SnapshotInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + SnapshotsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName) + .flatMap(new Func1>() { + @Override + public Observable call(SnapshotInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Snapshot)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + SnapshotsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toCompletable(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsInner.java new file mode 100644 index 0000000000000..08fb8e9277396 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/SnapshotsInner.java @@ -0,0 +1,962 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Snapshots. + */ +public class SnapshotsInner { + /** The Retrofit service to perform REST calls. */ + private SnapshotsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of SnapshotsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SnapshotsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(SnapshotsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Snapshots to be + * used by Retrofit to perform actually REST calls. + */ + interface SnapshotsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Snapshots list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Snapshots get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @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.netapp.v2020_07_01.Snapshots create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SnapshotInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Snapshots beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SnapshotInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Snapshots update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Body Object body, @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.netapp.v2020_07_01.Snapshots beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Body Object body, @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.netapp.v2020_07_01.Snapshots delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @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.netapp.v2020_07_01.Snapshots beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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<SnapshotInner> object if successful. + */ + public List list(String resourceGroupName, String accountName, String poolName, String volumeName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SnapshotInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SnapshotInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @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 SnapshotInner object if successful. + */ + public SnapshotInner get(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toBlocking().single().body(); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName), serviceCallback); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @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 SnapshotInner object if successful. + */ + public SnapshotInner create(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).toBlocking().last().body(); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location), serviceCallback); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + SnapshotInner body = new SnapshotInner(); + body.withLocation(location); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @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 SnapshotInner object if successful. + */ + public SnapshotInner beginCreate(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).toBlocking().single().body(); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location), serviceCallback); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + SnapshotInner body = new SnapshotInner(); + body.withLocation(location); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotInner object if successful. + */ + public SnapshotInner update(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).toBlocking().last().body(); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body), serviceCallback); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotInner object if successful. + */ + public SnapshotInner beginUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).toBlocking().single().body(); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body), serviceCallback); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toBlocking().last().body(); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName), serviceCallback); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toBlocking().single().body(); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName), serviceCallback); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultImpl.java new file mode 100644 index 0000000000000..0e7946366612e --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultImpl.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.Vault; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class VaultImpl extends WrapperImpl implements Vault { + private final NetAppManager manager; + + VaultImpl(VaultInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + + + @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 String type() { + return this.inner().type(); + } + + @Override + public String vaultName() { + return this.inner().vaultName(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultInner.java new file mode 100644 index 0000000000000..806b999b1eb88 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Vault information. + */ +@JsonFlatten +public class VaultInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Vault Name. + */ + @JsonProperty(value = "properties.vaultName") + private String vaultName; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the VaultInner object itself. + */ + public VaultInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get vault Name. + * + * @return the vaultName value + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Set vault Name. + * + * @param vaultName the vaultName value to set + * @return the VaultInner object itself. + */ + public VaultInner withVaultName(String vaultName) { + this.vaultName = vaultName; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsImpl.java new file mode 100644 index 0000000000000..2ad0933b08b65 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.Vaults; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.Vault; + +class VaultsImpl extends WrapperImpl implements Vaults { + private final NetAppManager manager; + + VaultsImpl(NetAppManager manager) { + super(manager.inner().vaults()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + private VaultImpl wrapModel(VaultInner inner) { + return new VaultImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + VaultsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Vault call(VaultInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsInner.java new file mode 100644 index 0000000000000..d9a35db865e9c --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VaultsInner.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. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Vaults. + */ +public class VaultsInner { + /** The Retrofit service to perform REST calls. */ + private VaultsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of VaultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VaultsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(VaultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Vaults to be + * used by Retrofit to perform actually REST calls. + */ + interface VaultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Vaults list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List vaults. + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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<VaultInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List vaults. + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @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 resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List vaults. + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<VaultInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List vaults. + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<VaultInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws 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/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeImpl.java new file mode 100644 index 0000000000000..e5846244de669 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeImpl.java @@ -0,0 +1,371 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.Volume; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePatch; +import com.microsoft.azure.management.netapp.v2020_07_01.ServiceLevel; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePropertiesExportPolicy; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.MountTargetProperties; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePropertiesDataProtection; +import com.microsoft.azure.management.netapp.v2020_07_01.SecurityStyle; +import java.util.Map; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePatchPropertiesDataProtection; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePatchPropertiesExportPolicy; +import rx.functions.Func1; + +class VolumeImpl extends CreatableUpdatableImpl implements Volume, Volume.Definition, Volume.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private String volumeName; + private VolumePatch updateParameter; + + VolumeImpl(String name, NetAppManager manager) { + super(name, new VolumeInner()); + this.manager = manager; + // Set resource name + this.volumeName = name; + // + this.updateParameter = new VolumePatch(); + } + + VolumeImpl(VolumeInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.volumeName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "capacityPools"); + this.volumeName = IdParsingUtils.getValueFromIdByName(inner.id(), "volumes"); + // + this.updateParameter = new VolumePatch(); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VolumesInner client = this.manager().inner().volumes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.inner()) + .map(new Func1() { + @Override + public VolumeInner call(VolumeInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VolumesInner client = this.manager().inner().volumes(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.updateParameter) + .map(new Func1() { + @Override + public VolumeInner call(VolumeInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VolumesInner client = this.manager().inner().volumes(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new VolumePatch(); + } + + @Override + public String backupId() { + return this.inner().backupId(); + } + + @Override + public String baremetalTenantId() { + return this.inner().baremetalTenantId(); + } + + @Override + public String creationToken() { + return this.inner().creationToken(); + } + + @Override + public VolumePropertiesDataProtection dataProtection() { + return this.inner().dataProtection(); + } + + @Override + public VolumePropertiesExportPolicy exportPolicy() { + return this.inner().exportPolicy(); + } + + @Override + public String fileSystemId() { + return this.inner().fileSystemId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isRestoring() { + return this.inner().isRestoring(); + } + + @Override + public Boolean kerberosEnabled() { + return this.inner().kerberosEnabled(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public List mountTargets() { + return this.inner().mountTargets(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List protocolTypes() { + return this.inner().protocolTypes(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SecurityStyle securityStyle() { + return this.inner().securityStyle(); + } + + @Override + public ServiceLevel serviceLevel() { + return this.inner().serviceLevel(); + } + + @Override + public Boolean snapshotDirectoryVisible() { + return this.inner().snapshotDirectoryVisible(); + } + + @Override + public String snapshotId() { + return this.inner().snapshotId(); + } + + @Override + public String subnetId() { + return this.inner().subnetId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Double throughputMibps() { + return this.inner().throughputMibps(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public long usageThreshold() { + return this.inner().usageThreshold(); + } + + @Override + public String volumeType() { + return this.inner().volumeType(); + } + + @Override + public VolumeImpl withExistingCapacityPool(String resourceGroupName, String accountName, String poolName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.poolName = poolName; + return this; + } + + @Override + public VolumeImpl withCreationToken(String creationToken) { + this.inner().withCreationToken(creationToken); + return this; + } + + @Override + public VolumeImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VolumeImpl withSubnetId(String subnetId) { + this.inner().withSubnetId(subnetId); + return this; + } + + @Override + public VolumeImpl withUsageThreshold(long usageThreshold) { + this.inner().withUsageThreshold(usageThreshold); + return this; + } + + @Override + public VolumeImpl withBackupId(String backupId) { + this.inner().withBackupId(backupId); + return this; + } + + @Override + public VolumeImpl withDataProtection(VolumePropertiesDataProtection dataProtection) { + this.inner().withDataProtection(dataProtection); + return this; + } + + @Override + public VolumeImpl withExportPolicy(VolumePropertiesExportPolicy exportPolicy) { + this.inner().withExportPolicy(exportPolicy); + return this; + } + + @Override + public VolumeImpl withIsRestoring(Boolean isRestoring) { + this.inner().withIsRestoring(isRestoring); + return this; + } + + @Override + public VolumeImpl withKerberosEnabled(Boolean kerberosEnabled) { + this.inner().withKerberosEnabled(kerberosEnabled); + return this; + } + + @Override + public VolumeImpl withMountTargets(List mountTargets) { + this.inner().withMountTargets(mountTargets); + return this; + } + + @Override + public VolumeImpl withProtocolTypes(List protocolTypes) { + this.inner().withProtocolTypes(protocolTypes); + return this; + } + + @Override + public VolumeImpl withSecurityStyle(SecurityStyle securityStyle) { + this.inner().withSecurityStyle(securityStyle); + return this; + } + + @Override + public VolumeImpl withSnapshotDirectoryVisible(Boolean snapshotDirectoryVisible) { + this.inner().withSnapshotDirectoryVisible(snapshotDirectoryVisible); + return this; + } + + @Override + public VolumeImpl withSnapshotId(String snapshotId) { + this.inner().withSnapshotId(snapshotId); + return this; + } + + @Override + public VolumeImpl withVolumeType(String volumeType) { + this.inner().withVolumeType(volumeType); + return this; + } + + @Override + public VolumeImpl withDataProtection(VolumePatchPropertiesDataProtection dataProtection) { + this.updateParameter.withDataProtection(dataProtection); + return this; + } + + @Override + public VolumeImpl withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy) { + this.updateParameter.withExportPolicy(exportPolicy); + return this; + } + + @Override + public VolumeImpl withUsageThreshold(Long usageThreshold) { + this.updateParameter.withUsageThreshold(usageThreshold); + return this; + } + + @Override + public VolumeImpl withServiceLevel(ServiceLevel serviceLevel) { + if (isInCreateMode()) { + this.inner().withServiceLevel(serviceLevel); + } else { + this.updateParameter.withServiceLevel(serviceLevel); + } + return this; + } + + @Override + public VolumeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public VolumeImpl withThroughputMibps(Double throughputMibps) { + if (isInCreateMode()) { + this.inner().withThroughputMibps(throughputMibps); + } else { + this.updateParameter.withThroughputMibps(throughputMibps); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeInner.java new file mode 100644 index 0000000000000..c79748cb87e14 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumeInner.java @@ -0,0 +1,507 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_07_01.ServiceLevel; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePropertiesExportPolicy; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.MountTargetProperties; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePropertiesDataProtection; +import com.microsoft.azure.management.netapp.v2020_07_01.SecurityStyle; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Volume resource. + */ +@JsonFlatten +public class VolumeInner extends Resource { + /** + * FileSystem ID. + * Unique FileSystem Identifier. + */ + @JsonProperty(value = "properties.fileSystemId", access = JsonProperty.Access.WRITE_ONLY) + private String fileSystemId; + + /** + * Creation Token or File Path. + * A unique file path for the volume. Used when creating mount targets. + */ + @JsonProperty(value = "properties.creationToken", required = true) + private String creationToken; + + /** + * serviceLevel. + * The service level of the file system. Possible values include: + * 'Standard', 'Premium', 'Ultra'. + */ + @JsonProperty(value = "properties.serviceLevel") + private ServiceLevel serviceLevel; + + /** + * usageThreshold. + * Maximum storage quota allowed for a file system in bytes. This is a soft + * quota used for alerting only. Minimum size is 100 GiB. Upper limit is + * 100TiB. Specified in bytes. + */ + @JsonProperty(value = "properties.usageThreshold", required = true) + private long usageThreshold; + + /** + * exportPolicy. + * Set of export policy rules. + */ + @JsonProperty(value = "properties.exportPolicy") + private VolumePropertiesExportPolicy exportPolicy; + + /** + * protocolTypes. + * Set of protocol types. + */ + @JsonProperty(value = "properties.protocolTypes") + private List protocolTypes; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Snapshot ID. + * UUID v4 or resource identifier used to identify the Snapshot. + */ + @JsonProperty(value = "properties.snapshotId") + private String snapshotId; + + /** + * Backup ID. + * UUID v4 or resource identifier used to identify the Backup. + */ + @JsonProperty(value = "properties.backupId") + private String backupId; + + /** + * Baremetal Tenant ID. + * Unique Baremetal Tenant Identifier. + */ + @JsonProperty(value = "properties.baremetalTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String baremetalTenantId; + + /** + * The Azure Resource URI for a delegated subnet. Must have the delegation + * Microsoft.NetApp/volumes. + */ + @JsonProperty(value = "properties.subnetId", required = true) + private String subnetId; + + /** + * mountTargets. + * List of mount targets. + */ + @JsonProperty(value = "properties.mountTargets") + private List mountTargets; + + /** + * What type of volume is this. + */ + @JsonProperty(value = "properties.volumeType") + private String volumeType; + + /** + * DataProtection. + * DataProtection type volumes include an object containing details of the + * replication. + */ + @JsonProperty(value = "properties.dataProtection") + private VolumePropertiesDataProtection dataProtection; + + /** + * Restoring. + */ + @JsonProperty(value = "properties.isRestoring") + private Boolean isRestoring; + + /** + * If enabled (true) the volume will contain a read-only .snapshot + * directory which provides access to each of the volume's snapshots + * (default to true). + */ + @JsonProperty(value = "properties.snapshotDirectoryVisible") + private Boolean snapshotDirectoryVisible; + + /** + * Describe if a volume is KerberosEnabled. To be use with swagger version + * 2020-05-01 or later. + */ + @JsonProperty(value = "properties.kerberosEnabled") + private Boolean kerberosEnabled; + + /** + * The security style of volume. Possible values include: 'ntfs', 'unix'. + */ + @JsonProperty(value = "properties.securityStyle") + private SecurityStyle securityStyle; + + /** + * Maximum throughput in Mibps that can be achieved by this volume, value + * between 1 and 4500. + */ + @JsonProperty(value = "properties.throughputMibps") + private Double throughputMibps; + + /** + * Get unique FileSystem Identifier. + * + * @return the fileSystemId value + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Get a unique file path for the volume. Used when creating mount targets. + * + * @return the creationToken value + */ + public String creationToken() { + return this.creationToken; + } + + /** + * Set a unique file path for the volume. Used when creating mount targets. + * + * @param creationToken the creationToken value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withCreationToken(String creationToken) { + this.creationToken = creationToken; + return this; + } + + /** + * Get the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @return the serviceLevel value + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @param serviceLevel the serviceLevel value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @return the usageThreshold value + */ + public long usageThreshold() { + return this.usageThreshold; + } + + /** + * Set maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @param usageThreshold the usageThreshold value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withUsageThreshold(long usageThreshold) { + this.usageThreshold = usageThreshold; + return this; + } + + /** + * Get set of export policy rules. + * + * @return the exportPolicy value + */ + public VolumePropertiesExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set set of export policy rules. + * + * @param exportPolicy the exportPolicy value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withExportPolicy(VolumePropertiesExportPolicy exportPolicy) { + this.exportPolicy = exportPolicy; + return this; + } + + /** + * Get set of protocol types. + * + * @return the protocolTypes value + */ + public List protocolTypes() { + return this.protocolTypes; + } + + /** + * Set set of protocol types. + * + * @param protocolTypes the protocolTypes value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withProtocolTypes(List protocolTypes) { + this.protocolTypes = protocolTypes; + return this; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get uUID v4 or resource identifier used to identify the Snapshot. + * + * @return the snapshotId value + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set uUID v4 or resource identifier used to identify the Snapshot. + * + * @param snapshotId the snapshotId value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + + /** + * Get uUID v4 or resource identifier used to identify the Backup. + * + * @return the backupId value + */ + public String backupId() { + return this.backupId; + } + + /** + * Set uUID v4 or resource identifier used to identify the Backup. + * + * @param backupId the backupId value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withBackupId(String backupId) { + this.backupId = backupId; + return this; + } + + /** + * Get unique Baremetal Tenant Identifier. + * + * @return the baremetalTenantId value + */ + public String baremetalTenantId() { + return this.baremetalTenantId; + } + + /** + * Get the Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + * + * @param subnetId the subnetId value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get list of mount targets. + * + * @return the mountTargets value + */ + public List mountTargets() { + return this.mountTargets; + } + + /** + * Set list of mount targets. + * + * @param mountTargets the mountTargets value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withMountTargets(List mountTargets) { + this.mountTargets = mountTargets; + return this; + } + + /** + * Get what type of volume is this. + * + * @return the volumeType value + */ + public String volumeType() { + return this.volumeType; + } + + /** + * Set what type of volume is this. + * + * @param volumeType the volumeType value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withVolumeType(String volumeType) { + this.volumeType = volumeType; + return this; + } + + /** + * Get dataProtection type volumes include an object containing details of the replication. + * + * @return the dataProtection value + */ + public VolumePropertiesDataProtection dataProtection() { + return this.dataProtection; + } + + /** + * Set dataProtection type volumes include an object containing details of the replication. + * + * @param dataProtection the dataProtection value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withDataProtection(VolumePropertiesDataProtection dataProtection) { + this.dataProtection = dataProtection; + return this; + } + + /** + * Get restoring. + * + * @return the isRestoring value + */ + public Boolean isRestoring() { + return this.isRestoring; + } + + /** + * Set restoring. + * + * @param isRestoring the isRestoring value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withIsRestoring(Boolean isRestoring) { + this.isRestoring = isRestoring; + return this; + } + + /** + * Get if enabled (true) the volume will contain a read-only .snapshot directory which provides access to each of the volume's snapshots (default to true). + * + * @return the snapshotDirectoryVisible value + */ + public Boolean snapshotDirectoryVisible() { + return this.snapshotDirectoryVisible; + } + + /** + * Set if enabled (true) the volume will contain a read-only .snapshot directory which provides access to each of the volume's snapshots (default to true). + * + * @param snapshotDirectoryVisible the snapshotDirectoryVisible value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withSnapshotDirectoryVisible(Boolean snapshotDirectoryVisible) { + this.snapshotDirectoryVisible = snapshotDirectoryVisible; + return this; + } + + /** + * Get describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. + * + * @return the kerberosEnabled value + */ + public Boolean kerberosEnabled() { + return this.kerberosEnabled; + } + + /** + * Set describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later. + * + * @param kerberosEnabled the kerberosEnabled value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withKerberosEnabled(Boolean kerberosEnabled) { + this.kerberosEnabled = kerberosEnabled; + return this; + } + + /** + * Get the security style of volume. Possible values include: 'ntfs', 'unix'. + * + * @return the securityStyle value + */ + public SecurityStyle securityStyle() { + return this.securityStyle; + } + + /** + * Set the security style of volume. Possible values include: 'ntfs', 'unix'. + * + * @param securityStyle the securityStyle value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withSecurityStyle(SecurityStyle securityStyle) { + this.securityStyle = securityStyle; + return this; + } + + /** + * Get the throughputMibps value. + * + * @return the throughputMibps value + */ + public Double throughputMibps() { + return this.throughputMibps; + } + + /** + * Set the throughputMibps value. + * + * @param throughputMibps the throughputMibps value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withThroughputMibps(Double throughputMibps) { + this.throughputMibps = throughputMibps; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesImpl.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesImpl.java new file mode 100644 index 0000000000000..891d007bf6f9e --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_07_01.Volumes; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_07_01.Volume; +import com.microsoft.azure.management.netapp.v2020_07_01.ReplicationStatus; + +class VolumesImpl extends WrapperImpl implements Volumes { + private final NetAppManager manager; + + VolumesImpl(NetAppManager manager) { + super(manager.inner().volumes()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public VolumeImpl define(String name) { + return wrapModel(name); + } + + private VolumeImpl wrapModel(VolumeInner inner) { + return new VolumeImpl(inner, manager()); + } + + private VolumeImpl wrapModel(String name) { + return new VolumeImpl(name, this.manager()); + } + + @Override + public Completable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.revertAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.breakReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.resyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.deleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.authorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable reInitializeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.reInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable poolChangeAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId) { + VolumesInner client = this.inner(); + return client.poolChangeAsync(resourceGroupName, accountName, poolName, volumeName, newPoolResourceId).toCompletable(); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName, String poolName) { + VolumesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, poolName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Volume call(VolumeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName, volumeName) + .flatMap(new Func1>() { + @Override + public Observable call(VolumeInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Volume)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Observable replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.replicationStatusMethodAsync(resourceGroupName, accountName, poolName, volumeName) + .map(new Func1() { + @Override + public ReplicationStatus call(ReplicationStatusInner inner) { + return new ReplicationStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesInner.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesInner.java new file mode 100644 index 0000000000000..cbac6e097a74f --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/VolumesInner.java @@ -0,0 +1,3028 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_07_01.AuthorizeRequest; +import com.microsoft.azure.management.netapp.v2020_07_01.BreakReplicationRequest; +import com.microsoft.azure.management.netapp.v2020_07_01.PoolChangeRequest; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumePatch; +import com.microsoft.azure.management.netapp.v2020_07_01.VolumeRevert; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Volumes. + */ +public class VolumesInner { + /** The Retrofit service to perform REST calls. */ + private VolumesService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of VolumesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VolumesInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(VolumesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Volumes to be + * used by Retrofit to perform actually REST calls. + */ + interface VolumesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.netapp.v2020_07_01.Volumes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumeInner body, @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.netapp.v2020_07_01.Volumes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumeInner body, @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.netapp.v2020_07_01.Volumes update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumePatch body, @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.netapp.v2020_07_01.Volumes beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumePatch body, @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.netapp.v2020_07_01.Volumes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes revert" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert") + Observable> revert(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VolumeRevert body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes beginRevert" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert") + Observable> beginRevert(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VolumeRevert body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes breakReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication") + Observable> breakReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BreakReplicationRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes beginBreakReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication") + Observable> beginBreakReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BreakReplicationRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes replicationStatusMethod" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus") + Observable> replicationStatusMethod(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes resyncReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication") + Observable> resyncReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes beginResyncReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication") + Observable> beginResyncReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes deleteReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication") + Observable> deleteReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes beginDeleteReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication") + Observable> beginDeleteReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes authorizeReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication") + Observable> authorizeReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizeRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes beginAuthorizeReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication") + Observable> beginAuthorizeReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizeRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes reInitializeReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication") + Observable> reInitializeReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes beginReInitializeReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication") + Observable> beginReInitializeReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @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.netapp.v2020_07_01.Volumes poolChange" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange") + Observable> poolChange(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PoolChangeRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_07_01.Volumes beginPoolChange" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange") + Observable> beginPoolChange(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PoolChangeRequest body, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @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<VolumeInner> object if successful. + */ + public List list(String resourceGroupName, String accountName, String poolName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @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 resourceGroupName, String accountName, String poolName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<VolumeInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName, String poolName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<VolumeInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 VolumeInner object if successful. + */ + public VolumeInner get(String resourceGroupName, String accountName, String poolName, String volumeName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner createOrUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().last().body(); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner beginCreateOrUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().single().body(); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner update(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().last().body(); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner beginUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().single().body(); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String poolName, String volumeName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 revert(String resourceGroupName, String accountName, String poolName, String volumeName) { + revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> revertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String snapshotId = null; + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(null); + Observable> observable = service.revert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @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 revert(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).toBlocking().last().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @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 revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + return revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> revertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(snapshotId); + Observable> observable = service.revert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginRevert(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRevertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String snapshotId = null; + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(null); + return service.beginRevert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRevertDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @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 beginRevert(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).toBlocking().single().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @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 beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + return beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRevertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(snapshotId); + return service.beginRevert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRevertDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRevertDelegate(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); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 breakReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> breakReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean forceBreakReplication = null; + BreakReplicationRequest body = new BreakReplicationRequest(); + body.withForceBreakReplication(null); + Observable> observable = service.breakReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @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 breakReplication(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication) { + breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, forceBreakReplication).toBlocking().last().body(); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @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 breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, forceBreakReplication), serviceCallback); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication) { + return breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, forceBreakReplication).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> breakReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BreakReplicationRequest body = null; + if (forceBreakReplication != null) { + body = new BreakReplicationRequest(); + body.withForceBreakReplication(forceBreakReplication); + } + Observable> observable = service.breakReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginBreakReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginBreakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginBreakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginBreakReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean forceBreakReplication = null; + BreakReplicationRequest body = new BreakReplicationRequest(); + body.withForceBreakReplication(null); + return service.beginBreakReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBreakReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @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 beginBreakReplication(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication) { + beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, forceBreakReplication).toBlocking().single().body(); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @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 beginBreakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, forceBreakReplication), serviceCallback); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginBreakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication) { + return beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, forceBreakReplication).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param forceBreakReplication If replication is in status transferring and you want to force break the replication, set to true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginBreakReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, Boolean forceBreakReplication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + BreakReplicationRequest body = null; + if (forceBreakReplication != null) { + body = new BreakReplicationRequest(); + body.withForceBreakReplication(forceBreakReplication); + } + return service.beginBreakReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBreakReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginBreakReplicationDelegate(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); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 ReplicationStatusInner object if successful. + */ + public ReplicationStatusInner replicationStatusMethod(String resourceGroupName, String accountName, String poolName, String volumeName) { + return replicationStatusMethodWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(replicationStatusMethodWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationStatusInner object + */ + public Observable replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return replicationStatusMethodWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, ReplicationStatusInner>() { + @Override + public ReplicationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationStatusInner object + */ + public Observable> replicationStatusMethodWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.replicationStatusMethod(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = replicationStatusMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse replicationStatusMethodDelegate(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); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + resyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return resyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resyncReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.resyncReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginResyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginResyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginResyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginResyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from destination to source. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResyncReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginResyncReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResyncReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResyncReplicationDelegate(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); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 deleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + deleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return deleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginDeleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginDeleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginDeleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteReplicationDelegate(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); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 authorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> authorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String remoteVolumeResourceId = null; + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(null); + Observable> observable = service.authorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @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 authorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).toBlocking().last().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @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 authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + return authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> authorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(remoteVolumeResourceId); + Observable> observable = service.authorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginAuthorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAuthorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String remoteVolumeResourceId = null; + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(null); + return service.beginAuthorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAuthorizeReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @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 beginAuthorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).toBlocking().single().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @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 beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + return beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAuthorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(remoteVolumeResourceId); + return service.beginAuthorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAuthorizeReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginAuthorizeReplicationDelegate(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); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 reInitializeReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + reInitializeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 reInitializeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reInitializeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable reInitializeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return reInitializeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> reInitializeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.reInitializeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginReInitializeReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginReInitializeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @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 beginReInitializeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginReInitializeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginReInitializeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginReInitializeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * ReInitialize volume replication. + * Re-Initializes the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginReInitializeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginReInitializeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginReInitializeReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginReInitializeReplicationDelegate(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); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @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 poolChange(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId) { + poolChangeWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, newPoolResourceId).toBlocking().last().body(); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @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 poolChangeAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(poolChangeWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, newPoolResourceId), serviceCallback); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable poolChangeAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId) { + return poolChangeWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, newPoolResourceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> poolChangeWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (newPoolResourceId == null) { + throw new IllegalArgumentException("Parameter newPoolResourceId is required and cannot be null."); + } + PoolChangeRequest body = new PoolChangeRequest(); + body.withNewPoolResourceId(newPoolResourceId); + Observable> observable = service.poolChange(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @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 beginPoolChange(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId) { + beginPoolChangeWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, newPoolResourceId).toBlocking().single().body(); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @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 beginPoolChangeAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPoolChangeWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, newPoolResourceId), serviceCallback); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginPoolChangeAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId) { + return beginPoolChangeWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, newPoolResourceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Change pool for volume. + * Moves volume to another pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param newPoolResourceId Resource id of the pool to move volume to + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginPoolChangeWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String newPoolResourceId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (newPoolResourceId == null) { + throw new IllegalArgumentException("Parameter newPoolResourceId is required and cannot be null."); + } + PoolChangeRequest body = new PoolChangeRequest(); + body.withNewPoolResourceId(newPoolResourceId); + return service.beginPoolChange(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPoolChangeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPoolChangeDelegate(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/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/package-info.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/package-info.java new file mode 100644 index 0000000000000..c2cee2283e769 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AzureNetAppFilesManagementClient. + * Microsoft NetApp Azure Resource Provider specification. + */ +package com.microsoft.azure.management.netapp.v2020_07_01.implementation; diff --git a/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/package-info.java b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/package-info.java new file mode 100644 index 0000000000000..bb4d7a9054e54 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/netapp/v2020_07_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AzureNetAppFilesManagementClient. + * Microsoft NetApp Azure Resource Provider specification. + */ +package com.microsoft.azure.management.netapp.v2020_07_01;