From 62654e1b3e009466295bf5a26e5c389d79a2bf73 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 29 Jan 2021 11:43:29 +0000 Subject: [PATCH] CodeGen from PR 12388 in Azure/azure-rest-api-specs Merge 5b30924e1fed644155918a7cbfa645d7509220c5 into d5479b525fd4d1a2bfcae9bd520f93913bac58cc --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../azure-resourcemanager-netapp/CHANGELOG.md | 5 + .../azure-resourcemanager-netapp/README.md | 99 + .../azure-resourcemanager-netapp/pom.xml | 62 + .../resourcemanager/netapp/NetAppManager.java | 334 ++ .../netapp/fluent/AccountBackupsClient.java | 131 + .../netapp/fluent/AccountsClient.java | 244 + .../netapp/fluent/BackupPoliciesClient.java | 232 + .../netapp/fluent/BackupsClient.java | 305 ++ .../netapp/fluent/NetAppManagementClient.java | 124 + .../netapp/fluent/NetAppResourcesClient.java | 100 + .../netapp/fluent/OperationsClient.java | 36 + .../netapp/fluent/PoolsClient.java | 263 ++ .../netapp/fluent/SnapshotPoliciesClient.java | 275 ++ .../netapp/fluent/SnapshotsClient.java | 358 ++ .../netapp/fluent/VaultsClient.java | 41 + .../netapp/fluent/VolumesClient.java | 857 ++++ .../netapp/fluent/models/BackupInner.java | 175 + .../fluent/models/BackupPolicyInner.java | 244 + .../fluent/models/BackupsListInner.java | 54 + .../fluent/models/CapacityPoolInner.java | 190 + .../CheckAvailabilityResponseInner.java | 120 + .../fluent/models/NetAppAccountInner.java | 137 + .../netapp/fluent/models/OperationInner.java | 138 + .../fluent/models/ReplicationStatusInner.java | 156 + .../netapp/fluent/models/SnapshotInner.java | 104 + .../fluent/models/SnapshotPolicyInner.java | 203 + .../models/SnapshotPolicyVolumeListInner.java | 51 + .../netapp/fluent/models/VaultInner.java | 84 + .../netapp/fluent/models/VolumeInner.java | 622 +++ .../netapp/fluent/models/package-info.java | 9 + .../netapp/fluent/package-info.java | 9 + .../AccountBackupsClientImpl.java | 665 +++ .../implementation/AccountBackupsImpl.java | 94 + .../implementation/AccountsClientImpl.java | 1281 ++++++ .../netapp/implementation/AccountsImpl.java | 164 + .../netapp/implementation/BackupImpl.java | 212 + .../BackupPoliciesClientImpl.java | 1223 +++++ .../implementation/BackupPoliciesImpl.java | 196 + .../implementation/BackupPolicyImpl.java | 285 ++ .../implementation/BackupsClientImpl.java | 1498 +++++++ .../netapp/implementation/BackupsImpl.java | 269 ++ .../implementation/BackupsListImpl.java | 44 + .../implementation/CapacityPoolImpl.java | 229 + .../CheckAvailabilityResponseImpl.java | 41 + .../implementation/NetAppAccountImpl.java | 212 + .../NetAppManagementClientBuilder.java | 149 + .../NetAppManagementClientImpl.java | 438 ++ .../NetAppResourcesClientImpl.java | 557 +++ .../implementation/NetAppResourcesImpl.java | 111 + .../netapp/implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 176 + .../netapp/implementation/OperationsImpl.java | 46 + .../implementation/PoolsClientImpl.java | 1377 ++++++ .../netapp/implementation/PoolsImpl.java | 192 + .../implementation/ReplicationStatusImpl.java | 50 + .../netapp/implementation/SnapshotImpl.java | 147 + .../SnapshotPoliciesClientImpl.java | 1411 ++++++ .../implementation/SnapshotPoliciesImpl.java | 228 + .../implementation/SnapshotPolicyImpl.java | 254 ++ .../SnapshotPolicyVolumeListImpl.java | 39 + .../implementation/SnapshotsClientImpl.java | 1620 +++++++ .../netapp/implementation/SnapshotsImpl.java | 305 ++ .../netapp/implementation/Utils.java | 67 + .../netapp/implementation/VaultImpl.java | 48 + .../implementation/VaultsClientImpl.java | 239 + .../netapp/implementation/VaultsImpl.java | 46 + .../netapp/implementation/VolumeImpl.java | 465 ++ .../implementation/VolumesClientImpl.java | 3980 +++++++++++++++++ .../netapp/implementation/VolumesImpl.java | 351 ++ .../netapp/implementation/package-info.java | 9 + .../netapp/models/AccountBackups.java | 88 + .../netapp/models/AccountEncryption.java | 50 + .../netapp/models/Accounts.java | 136 + .../netapp/models/ActiveDirectory.java | 503 +++ .../netapp/models/ActiveDirectoryStatus.java | 43 + .../netapp/models/AuthorizeRequest.java | 50 + .../resourcemanager/netapp/models/Backup.java | 249 ++ .../netapp/models/BackupPatch.java | 170 + .../netapp/models/BackupPolicies.java | 142 + .../netapp/models/BackupPoliciesList.java | 55 + .../netapp/models/BackupPolicy.java | 406 ++ .../netapp/models/BackupPolicyPatch.java | 243 + .../netapp/models/Backups.java | 166 + .../netapp/models/BackupsList.java | 25 + .../models/BreakReplicationRequest.java | 53 + .../netapp/models/CapacityPool.java | 299 ++ .../netapp/models/CapacityPoolList.java | 81 + .../netapp/models/CapacityPoolPatch.java | 97 + .../models/CheckAvailabilityResponse.java | 43 + .../netapp/models/CheckNameResourceTypes.java | 44 + .../models/CheckQuotaNameResourceTypes.java | 45 + .../netapp/models/CreatedByType.java | 40 + .../netapp/models/DailySchedule.java | 128 + .../netapp/models/Dimension.java | 76 + .../netapp/models/EndpointType.java | 34 + .../netapp/models/ExportPolicyRule.java | 409 ++ .../netapp/models/HourlySchedule.java | 102 + .../models/InAvailabilityReasonType.java | 34 + .../netapp/models/KeySource.java | 31 + .../netapp/models/MetricSpecification.java | 262 ++ .../netapp/models/MirrorState.java | 37 + .../netapp/models/MonthlySchedule.java | 157 + .../netapp/models/MountTargetProperties.java | 112 + .../netapp/models/NetAppAccount.java | 262 ++ .../netapp/models/NetAppAccountList.java | 81 + .../netapp/models/NetAppAccountPatch.java | 116 + .../netapp/models/NetAppResources.java | 89 + .../netapp/models/Operation.java | 45 + .../netapp/models/OperationDisplay.java | 128 + .../netapp/models/OperationListResult.java | 58 + .../netapp/models/Operations.java | 31 + .../netapp/models/PoolChangeRequest.java | 56 + .../resourcemanager/netapp/models/Pools.java | 142 + .../netapp/models/QosType.java | 34 + .../models/QuotaAvailabilityRequest.java | 118 + .../netapp/models/RelationshipStatus.java | 34 + .../netapp/models/ReplicationObject.java | 169 + .../netapp/models/ReplicationSchedule.java | 37 + .../netapp/models/ReplicationStatus.java | 52 + .../ResourceNameAvailabilityRequest.java | 120 + .../netapp/models/SecurityStyle.java | 34 + .../netapp/models/ServiceLevel.java | 37 + .../netapp/models/ServiceSpecification.java | 54 + .../netapp/models/Snapshot.java | 163 + .../netapp/models/SnapshotPolicies.java | 170 + .../netapp/models/SnapshotPoliciesList.java | 55 + .../netapp/models/SnapshotPolicy.java | 347 ++ .../netapp/models/SnapshotPolicyPatch.java | 296 ++ .../models/SnapshotPolicyVolumeList.java | 25 + .../netapp/models/Snapshots.java | 212 + .../netapp/models/SnapshotsList.java | 55 + .../netapp/models/SystemData.java | 181 + .../resourcemanager/netapp/models/Vault.java | 52 + .../netapp/models/VaultList.java | 55 + .../resourcemanager/netapp/models/Vaults.java | 36 + .../resourcemanager/netapp/models/Volume.java | 782 ++++ .../netapp/models/VolumeBackupProperties.java | 128 + .../netapp/models/VolumeBackups.java | 102 + .../netapp/models/VolumeList.java | 81 + .../netapp/models/VolumePatch.java | 185 + .../VolumePatchPropertiesDataProtection.java | 53 + .../VolumePatchPropertiesExportPolicy.java | 54 + .../VolumePropertiesDataProtection.java | 111 + .../models/VolumePropertiesExportPolicy.java | 54 + .../netapp/models/VolumeRevert.java | 50 + .../models/VolumeSnapshotProperties.java | 50 + .../netapp/models/Volumes.java | 421 ++ .../netapp/models/WeeklySchedule.java | 157 + .../netapp/models/package-info.java | 9 + .../resourcemanager/netapp/package-info.java | 8 + .../src/main/java/module-info.java | 19 + sdk/netapp/ci.yml | 31 + sdk/netapp/pom.xml | 53 + 155 files changed, 34630 insertions(+) create mode 100644 sdk/netapp/azure-resourcemanager-netapp/CHANGELOG.md create mode 100644 sdk/netapp/azure-resourcemanager-netapp/README.md create mode 100644 sdk/netapp/azure-resourcemanager-netapp/pom.xml create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/NetAppManager.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountBackupsClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountsClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupPoliciesClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupsClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppManagementClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppResourcesClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/OperationsClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/PoolsClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotPoliciesClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotsClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VaultsClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VolumesClient.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupPolicyInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupsListInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CapacityPoolInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CheckAvailabilityResponseInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/NetAppAccountInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/OperationInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/ReplicationStatusInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyVolumeListInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VaultInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VolumeInner.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/package-info.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/package-info.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPolicyImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsListImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CapacityPoolImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CheckAvailabilityResponseImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppAccountImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientBuilder.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/ReplicationStatusImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyVolumeListImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/Utils.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumeImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesClientImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesImpl.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/package-info.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountBackups.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountEncryption.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Accounts.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectory.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectoryStatus.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AuthorizeRequest.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backup.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPatch.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicies.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPoliciesList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicy.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicyPatch.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backups.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupsList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BreakReplicationRequest.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPool.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolPatch.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckAvailabilityResponse.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckNameResourceTypes.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckQuotaNameResourceTypes.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CreatedByType.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/DailySchedule.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Dimension.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/EndpointType.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ExportPolicyRule.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/HourlySchedule.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/InAvailabilityReasonType.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/KeySource.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MetricSpecification.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MirrorState.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MonthlySchedule.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MountTargetProperties.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccount.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountPatch.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppResources.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operation.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationDisplay.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationListResult.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operations.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/PoolChangeRequest.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Pools.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QosType.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QuotaAvailabilityRequest.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/RelationshipStatus.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationObject.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationSchedule.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationStatus.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ResourceNameAvailabilityRequest.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SecurityStyle.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceLevel.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceSpecification.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshot.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicies.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPoliciesList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicy.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyPatch.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyVolumeList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshots.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotsList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SystemData.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vault.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VaultList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vaults.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volume.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackupProperties.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackups.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeList.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatch.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesDataProtection.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesExportPolicy.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesDataProtection.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesExportPolicy.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeRevert.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeSnapshotProperties.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volumes.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/WeeklySchedule.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/package-info.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/package-info.java create mode 100644 sdk/netapp/azure-resourcemanager-netapp/src/main/java/module-info.java create mode 100644 sdk/netapp/ci.yml create mode 100644 sdk/netapp/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 3ee20839eb80..416d4b4cee73 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -198,6 +198,7 @@ com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-netapp;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index 0d1c2a17109a..cbc193a57ae3 100644 --- a/pom.xml +++ b/pom.xml @@ -571,6 +571,7 @@ sdk/metricsadvisor sdk/monitor sdk/mysql + sdk/netapp sdk/postgresql sdk/recoveryservices sdk/relay diff --git a/sdk/netapp/azure-resourcemanager-netapp/CHANGELOG.md b/sdk/netapp/azure-resourcemanager-netapp/CHANGELOG.md new file mode 100644 index 000000000000..179621f3a7e1 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-01-29) + +- Azure Resource Manager NetApp client library for Java. This package contains Microsoft Azure SDK for NetApp Management SDK. Microsoft NetApp Azure Resource Provider specification. Package tag package-netapp-2020-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/netapp/azure-resourcemanager-netapp/README.md b/sdk/netapp/azure-resourcemanager-netapp/README.md new file mode 100644 index 000000000000..7cf73ba09abe --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager NetApp client library for Java + +Azure Resource Manager NetApp client library for Java. + +This package contains Microsoft Azure SDK for NetApp Management SDK. Microsoft NetApp Azure Resource Provider specification. Package tag package-netapp-2020-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-netapp;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-netapp + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +NetAppManager manager = NetAppManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/netapp/azure-resourcemanager-netapp/pom.xml b/sdk/netapp/azure-resourcemanager-netapp/pom.xml new file mode 100644 index 000000000000..9aab95eb6e52 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-netapp + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for NetApp Management + This package contains Microsoft Azure SDK for NetApp Management SDK. Microsoft NetApp Azure Resource Provider specification. Package tag package-netapp-2020-11-01. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core-management + 1.1.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/NetAppManager.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/NetAppManager.java new file mode 100644 index 000000000000..42303b91ab43 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/NetAppManager.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.NetAppManagementClient; +import com.azure.resourcemanager.netapp.implementation.AccountBackupsImpl; +import com.azure.resourcemanager.netapp.implementation.AccountsImpl; +import com.azure.resourcemanager.netapp.implementation.BackupPoliciesImpl; +import com.azure.resourcemanager.netapp.implementation.BackupsImpl; +import com.azure.resourcemanager.netapp.implementation.NetAppManagementClientBuilder; +import com.azure.resourcemanager.netapp.implementation.NetAppResourcesImpl; +import com.azure.resourcemanager.netapp.implementation.OperationsImpl; +import com.azure.resourcemanager.netapp.implementation.PoolsImpl; +import com.azure.resourcemanager.netapp.implementation.SnapshotPoliciesImpl; +import com.azure.resourcemanager.netapp.implementation.SnapshotsImpl; +import com.azure.resourcemanager.netapp.implementation.VaultsImpl; +import com.azure.resourcemanager.netapp.implementation.VolumesImpl; +import com.azure.resourcemanager.netapp.models.AccountBackups; +import com.azure.resourcemanager.netapp.models.Accounts; +import com.azure.resourcemanager.netapp.models.BackupPolicies; +import com.azure.resourcemanager.netapp.models.Backups; +import com.azure.resourcemanager.netapp.models.NetAppResources; +import com.azure.resourcemanager.netapp.models.Operations; +import com.azure.resourcemanager.netapp.models.Pools; +import com.azure.resourcemanager.netapp.models.SnapshotPolicies; +import com.azure.resourcemanager.netapp.models.Snapshots; +import com.azure.resourcemanager.netapp.models.Vaults; +import com.azure.resourcemanager.netapp.models.Volumes; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to NetAppManager. Microsoft NetApp Azure Resource Provider specification. */ +public final class NetAppManager { + 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; + + private final NetAppManagementClient clientObject; + + private NetAppManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new NetAppManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of NetApp service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the NetApp service API instance. + */ + public static NetAppManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create NetAppManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new NetAppManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of NetApp service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the NetApp service API instance. + */ + public NetAppManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.netapp") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new NetAppManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of NetAppResources. */ + public NetAppResources netAppResources() { + if (this.netAppResources == null) { + this.netAppResources = new NetAppResourcesImpl(clientObject.getNetAppResources(), this); + } + return netAppResources; + } + + /** @return Resource collection API of Accounts. */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(clientObject.getAccounts(), this); + } + return accounts; + } + + /** @return Resource collection API of Pools. */ + public Pools pools() { + if (this.pools == null) { + this.pools = new PoolsImpl(clientObject.getPools(), this); + } + return pools; + } + + /** @return Resource collection API of Volumes. */ + public Volumes volumes() { + if (this.volumes == null) { + this.volumes = new VolumesImpl(clientObject.getVolumes(), this); + } + return volumes; + } + + /** @return Resource collection API of Snapshots. */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this); + } + return snapshots; + } + + /** @return Resource collection API of SnapshotPolicies. */ + public SnapshotPolicies snapshotPolicies() { + if (this.snapshotPolicies == null) { + this.snapshotPolicies = new SnapshotPoliciesImpl(clientObject.getSnapshotPolicies(), this); + } + return snapshotPolicies; + } + + /** @return Resource collection API of AccountBackups. */ + public AccountBackups accountBackups() { + if (this.accountBackups == null) { + this.accountBackups = new AccountBackupsImpl(clientObject.getAccountBackups(), this); + } + return accountBackups; + } + + /** @return Resource collection API of Backups. */ + public Backups backups() { + if (this.backups == null) { + this.backups = new BackupsImpl(clientObject.getBackups(), this); + } + return backups; + } + + /** @return Resource collection API of BackupPolicies. */ + public BackupPolicies backupPolicies() { + if (this.backupPolicies == null) { + this.backupPolicies = new BackupPoliciesImpl(clientObject.getBackupPolicies(), this); + } + return backupPolicies; + } + + /** @return Resource collection API of Vaults. */ + public Vaults vaults() { + if (this.vaults == null) { + this.vaults = new VaultsImpl(clientObject.getVaults(), this); + } + return vaults; + } + + /** + * @return Wrapped service client NetAppManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public NetAppManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountBackupsClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountBackupsClient.java new file mode 100644 index 000000000000..f38463e7b902 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountBackupsClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.fluent.models.BackupsListInner; + +/** An instance of this class provides access to all the operations defined in AccountBackupsClient. */ +public interface AccountBackupsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupsListInner list(String resourceGroupName, String accountName); + + /** + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInner get(String resourceGroupName, String accountName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String backupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String backupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String backupName, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountsClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountsClient.java new file mode 100644 index 000000000000..b3be7e6aea7f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/AccountsClient.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner; +import com.azure.resourcemanager.netapp.models.NetAppAccountPatch; + +/** An instance of this class provides access to all the operations defined in AccountsClient. */ +public interface AccountsClient { + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetAppAccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetAppAccountInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, NetAppAccountInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetAppAccountInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, NetAppAccountInner body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetAppAccountInner createOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetAppAccountInner createOrUpdate( + String resourceGroupName, String accountName, NetAppAccountInner body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName); + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName); + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetAppAccountInner> beginUpdate( + String resourceGroupName, String accountName, NetAppAccountPatch body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NetAppAccountInner> beginUpdate( + String resourceGroupName, String accountName, NetAppAccountPatch body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetAppAccountInner update(String resourceGroupName, String accountName, NetAppAccountPatch body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetAppAccountInner update(String resourceGroupName, String accountName, NetAppAccountPatch body, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupPoliciesClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupPoliciesClient.java new file mode 100644 index 000000000000..a56eeccc61ec --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupPoliciesClient.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner; +import com.azure.resourcemanager.netapp.models.BackupPolicyPatch; + +/** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */ +public interface BackupPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupPolicyInner get(String resourceGroupName, String accountName, String backupPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String backupPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BackupPolicyInner> beginCreate( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BackupPolicyInner> beginCreate( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupPolicyInner create( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupPolicyInner create( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupPolicyInner update( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String backupPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String backupPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String backupPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String backupPolicyName, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupsClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupsClient.java new file mode 100644 index 000000000000..f6d14e84f8a8 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/BackupsClient.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.models.BackupPatch; + +/** An instance of this class provides access to all the operations defined in BackupsClient. */ +public interface BackupsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInner get( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BackupInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BackupInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInner update( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupPatch body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppManagementClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppManagementClient.java new file mode 100644 index 000000000000..2a596c2c3844 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppManagementClient.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for NetAppManagementClient class. */ +public interface NetAppManagementClient { + /** + * 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. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the NetAppResourcesClient object to access its operations. + * + * @return the NetAppResourcesClient object. + */ + NetAppResourcesClient getNetAppResources(); + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + AccountsClient getAccounts(); + + /** + * Gets the PoolsClient object to access its operations. + * + * @return the PoolsClient object. + */ + PoolsClient getPools(); + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + VolumesClient getVolumes(); + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + SnapshotsClient getSnapshots(); + + /** + * Gets the SnapshotPoliciesClient object to access its operations. + * + * @return the SnapshotPoliciesClient object. + */ + SnapshotPoliciesClient getSnapshotPolicies(); + + /** + * Gets the AccountBackupsClient object to access its operations. + * + * @return the AccountBackupsClient object. + */ + AccountBackupsClient getAccountBackups(); + + /** + * Gets the BackupsClient object to access its operations. + * + * @return the BackupsClient object. + */ + BackupsClient getBackups(); + + /** + * Gets the BackupPoliciesClient object to access its operations. + * + * @return the BackupPoliciesClient object. + */ + BackupPoliciesClient getBackupPolicies(); + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + VaultsClient getVaults(); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppResourcesClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppResourcesClient.java new file mode 100644 index 000000000000..764153916ae7 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/NetAppResourcesClient.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.CheckAvailabilityResponseInner; +import com.azure.resourcemanager.netapp.models.QuotaAvailabilityRequest; +import com.azure.resourcemanager.netapp.models.ResourceNameAvailabilityRequest; + +/** An instance of this class provides access to all the operations defined in NetAppResourcesClient. */ +public interface NetAppResourcesClient { + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckAvailabilityResponseInner checkNameAvailability(String location, ResourceNameAvailabilityRequest body); + + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context); + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckAvailabilityResponseInner checkFilePathAvailability(String location, ResourceNameAvailabilityRequest body); + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkFilePathAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context); + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckAvailabilityResponseInner checkQuotaAvailability(String location, QuotaAvailabilityRequest body); + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkQuotaAvailabilityWithResponse( + String location, QuotaAvailabilityRequest body, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/OperationsClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/OperationsClient.java new file mode 100644 index 000000000000..a894048f61e2 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/PoolsClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/PoolsClient.java new file mode 100644 index 000000000000..d01a83d6b3a9 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/PoolsClient.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.CapacityPoolInner; +import com.azure.resourcemanager.netapp.models.CapacityPoolPatch; + +/** An instance of this class provides access to all the operations defined in PoolsClient. */ +public interface PoolsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityPoolInner get(String resourceGroupName, String accountName, String poolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String poolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityPoolInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityPoolInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityPoolInner createOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityPoolInner createOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityPoolInner> beginUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CapacityPoolInner> beginUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityPoolInner update(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapacityPoolInner update( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String poolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String poolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String poolName, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotPoliciesClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotPoliciesClient.java new file mode 100644 index 000000000000..4476cf5731c4 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotPoliciesClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyInner; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyVolumeListInner; +import com.azure.resourcemanager.netapp.models.SnapshotPolicyPatch; + +/** An instance of this class provides access to all the operations defined in SnapshotPoliciesClient. */ +public interface SnapshotPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotPolicyInner get(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotPolicyInner create( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyInner body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotPolicyInner> beginUpdate( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotPolicyInner> beginUpdate( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyPatch body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotPolicyInner update( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotPolicyInner update( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyPatch body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String snapshotPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotPolicyVolumeListInner listVolumes(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listVolumesWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotsClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotsClient.java new file mode 100644 index 000000000000..6212bdc858f8 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/SnapshotsClient.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotInner; + +/** An instance of this class provides access to all the operations defined in SnapshotsClient. */ +public interface SnapshotsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner get( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context); + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body); + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body, + Context context); + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body); + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VaultsClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VaultsClient.java new file mode 100644 index 000000000000..e654be303462 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VaultsClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.VaultInner; + +/** An instance of this class provides access to all the operations defined in VaultsClient. */ +public interface VaultsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VolumesClient.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VolumesClient.java new file mode 100644 index 000000000000..a847c28d7219 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/VolumesClient.java @@ -0,0 +1,857 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.models.ReplicationStatusInner; +import com.azure.resourcemanager.netapp.fluent.models.VolumeInner; +import com.azure.resourcemanager.netapp.models.AuthorizeRequest; +import com.azure.resourcemanager.netapp.models.BreakReplicationRequest; +import com.azure.resourcemanager.netapp.models.PoolChangeRequest; +import com.azure.resourcemanager.netapp.models.VolumePatch; +import com.azure.resourcemanager.netapp.models.VolumeRevert; + +/** An instance of this class provides access to all the operations defined in VolumesClient. */ +public interface VolumesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String poolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String poolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner get(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeInner body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner createOrUpdate( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner createOrUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeInner body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumePatch body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner update( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumePatch body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevert( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body); + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevert( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context); + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revert(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body); + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revert( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context); + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginBreakReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, BreakReplicationRequest body); + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginBreakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context); + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void breakReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, BreakReplicationRequest body); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void breakReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void breakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationStatusInner replicationStatus( + String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response replicationStatusWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginAuthorizeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body); + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginAuthorizeReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context); + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void authorizeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body); + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void authorizeReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reInitializeReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPoolChange( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body); + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPoolChange( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context); + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void poolChange( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body); + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void poolChange( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupInner.java new file mode 100644 index 000000000000..003ff018b511 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Backup of a Volume. */ +@JsonFlatten +@Fluent +public class BackupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInner.class); + + /* + * Resource location + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * UUID v4 used to identify the Backup + */ + @JsonProperty(value = "properties.backupId", access = JsonProperty.Access.WRITE_ONLY) + private String backupId; + + /* + * The creation date of the backup + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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; + + /* + * Failure reason + */ + @JsonProperty(value = "properties.failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: 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 the backupId property: UUID v4 used to identify the Backup. + * + * @return the backupId value. + */ + public String backupId() { + return this.backupId; + } + + /** + * Get the creationDate property: The creation date of the backup. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the size property: Size of backup. + * + * @return the size value. + */ + public Long size() { + return this.size; + } + + /** + * Get the label property: Label for backup. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: 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 the backupType property: Type of backup adhoc or scheduled. + * + * @return the backupType value. + */ + public String backupType() { + return this.backupType; + } + + /** + * Get the failureReason property: Failure reason. + * + * @return the failureReason value. + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model BackupInner")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupPolicyInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupPolicyInner.java new file mode 100644 index 000000000000..131e35011e89 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupPolicyInner.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.VolumeBackups; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Backup policy information. */ +@JsonFlatten +@Fluent +public class BackupPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPolicyInner.class); + + /* + * 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 the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the dailyBackupsToKeep property: Daily backups count to keep. + * + * @return the dailyBackupsToKeep value. + */ + public Integer dailyBackupsToKeep() { + return this.dailyBackupsToKeep; + } + + /** + * Set the dailyBackupsToKeep property: 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 the weeklyBackupsToKeep property: Weekly backups count to keep. + * + * @return the weeklyBackupsToKeep value. + */ + public Integer weeklyBackupsToKeep() { + return this.weeklyBackupsToKeep; + } + + /** + * Set the weeklyBackupsToKeep property: 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 the monthlyBackupsToKeep property: Monthly backups count to keep. + * + * @return the monthlyBackupsToKeep value. + */ + public Integer monthlyBackupsToKeep() { + return this.monthlyBackupsToKeep; + } + + /** + * Set the monthlyBackupsToKeep property: 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 the yearlyBackupsToKeep property: Yearly backups count to keep. + * + * @return the yearlyBackupsToKeep value. + */ + public Integer yearlyBackupsToKeep() { + return this.yearlyBackupsToKeep; + } + + /** + * Set the yearlyBackupsToKeep property: 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 the volumesAssigned property: Volumes using current backup policy. + * + * @return the volumesAssigned value. + */ + public Integer volumesAssigned() { + return this.volumesAssigned; + } + + /** + * Set the volumesAssigned property: 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 enabled property: The property to decide policy is enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: 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 the volumeBackups property: A list of volumes assigned to this policy. + * + * @return the volumeBackups value. + */ + public List volumeBackups() { + return this.volumeBackups; + } + + /** + * Set the volumeBackups property: 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; + } + + /** {@inheritDoc} */ + @Override + public BackupPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeBackups() != null) { + volumeBackups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupsListInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupsListInner.java new file mode 100644 index 000000000000..2a57f3d69d2b --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/BackupsListInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Backups. */ +@Fluent +public final class BackupsListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupsListInner.class); + + /* + * A list of Backups + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: A list of Backups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CapacityPoolInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CapacityPoolInner.java new file mode 100644 index 000000000000..5bf7ad391794 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CapacityPoolInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.QosType; +import com.azure.resourcemanager.netapp.models.ServiceLevel; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Capacity pool resource. */ +@JsonFlatten +@Fluent +public class CapacityPoolInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityPoolInner.class); + + /* + * UUID v4 used to identify the Pool + */ + @JsonProperty(value = "properties.poolId", access = JsonProperty.Access.WRITE_ONLY) + private String poolId; + + /* + * 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; + + /* + * The service level of the file system + */ + @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 Float totalThroughputMibps; + + /* + * Utilized throughput of pool in Mibps + */ + @JsonProperty(value = "properties.utilizedThroughputMibps", access = JsonProperty.Access.WRITE_ONLY) + private Float utilizedThroughputMibps; + + /* + * The qos type of the pool + */ + @JsonProperty(value = "properties.qosType") + private QosType qosType; + + /** + * Get the poolId property: UUID v4 used to identify the Pool. + * + * @return the poolId value. + */ + public String poolId() { + return this.poolId; + } + + /** + * Get the size property: 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 the size property: 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 serviceLevel property: The service level of the file system. + * + * @return the serviceLevel value. + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the serviceLevel property: The service level of the file system. + * + * @param serviceLevel the serviceLevel value to set. + * @return the CapacityPoolInner object itself. + */ + public CapacityPoolInner withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the totalThroughputMibps property: Total throughput of pool in Mibps. + * + * @return the totalThroughputMibps value. + */ + public Float totalThroughputMibps() { + return this.totalThroughputMibps; + } + + /** + * Get the utilizedThroughputMibps property: Utilized throughput of pool in Mibps. + * + * @return the utilizedThroughputMibps value. + */ + public Float utilizedThroughputMibps() { + return this.utilizedThroughputMibps; + } + + /** + * Get the qosType property: The qos type of the pool. + * + * @return the qosType value. + */ + public QosType qosType() { + return this.qosType; + } + + /** + * Set the qosType property: The qos type of the pool. + * + * @param qosType the qosType value to set. + * @return the CapacityPoolInner object itself. + */ + public CapacityPoolInner withQosType(QosType qosType) { + this.qosType = qosType; + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceLevel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property serviceLevel in model CapacityPoolInner")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CheckAvailabilityResponseInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CheckAvailabilityResponseInner.java new file mode 100644 index 000000000000..d161dbac43e7 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/CheckAvailabilityResponseInner.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.InAvailabilityReasonType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information regarding availability of a resource. */ +@Fluent +public final class CheckAvailabilityResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckAvailabilityResponseInner.class); + + /* + * true indicates name is valid and available. + * false indicates the name is invalid, unavailable, or both. + */ + @JsonProperty(value = "isAvailable") + private Boolean isAvailable; + + /* + * Invalid indicates the name provided does not match Azure + * App Service naming requirements. AlreadyExists indicates + * that the name is already in use and is therefore unavailable. + */ + @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 the isAvailable property: <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 the isAvailable property: <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 the reason property: <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. + * + * @return the reason value. + */ + public InAvailabilityReasonType reason() { + return this.reason; + } + + /** + * Set the reason property: <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. + * + * @param reason the reason value to set. + * @return the CheckAvailabilityResponseInner object itself. + */ + public CheckAvailabilityResponseInner withReason(InAvailabilityReasonType reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: 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 the message property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/NetAppAccountInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/NetAppAccountInner.java new file mode 100644 index 000000000000..d48ce96ad96c --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/NetAppAccountInner.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.AccountEncryption; +import com.azure.resourcemanager.netapp.models.ActiveDirectory; +import com.azure.resourcemanager.netapp.models.SystemData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetApp account resource. */ +@JsonFlatten +@Fluent +public class NetAppAccountInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetAppAccountInner.class); + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Azure lifecycle management + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Active Directories + */ + @JsonProperty(value = "properties.activeDirectories") + private List activeDirectories; + + /* + * Encryption settings + */ + @JsonProperty(value = "properties.encryption") + private AccountEncryption encryption; + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the activeDirectories property: Active Directories. + * + * @return the activeDirectories value. + */ + public List activeDirectories() { + return this.activeDirectories; + } + + /** + * Set the activeDirectories property: Active Directories. + * + * @param activeDirectories the activeDirectories value to set. + * @return the NetAppAccountInner object itself. + */ + public NetAppAccountInner withActiveDirectories(List activeDirectories) { + this.activeDirectories = activeDirectories; + return this; + } + + /** + * Get the encryption property: Encryption settings. + * + * @return the encryption value. + */ + public AccountEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption settings. + * + * @param encryption the encryption value to set. + * @return the NetAppAccountInner object itself. + */ + public NetAppAccountInner withEncryption(AccountEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetAppAccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetAppAccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + if (activeDirectories() != null) { + activeDirectories().forEach(e -> e.validate()); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/OperationInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/OperationInner.java new file mode 100644 index 000000000000..dac62f6efb59 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/OperationInner.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.OperationDisplay; +import com.azure.resourcemanager.netapp.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Microsoft.NetApp REST API operation definition. */ +@JsonFlatten +@Fluent +public class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * 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 the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: 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 property: The origin of operations. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: 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 the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/ReplicationStatusInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/ReplicationStatusInner.java new file mode 100644 index 000000000000..dfeae58906d3 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/ReplicationStatusInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.MirrorState; +import com.azure.resourcemanager.netapp.models.RelationshipStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication status. */ +@Fluent +public final class ReplicationStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationStatusInner.class); + + /* + * Replication health check + */ + @JsonProperty(value = "healthy") + private Boolean healthy; + + /* + * Status of the mirror relationship + */ + @JsonProperty(value = "relationshipStatus") + private RelationshipStatus relationshipStatus; + + /* + * The status of the replication + */ + @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 the healthy property: Replication health check. + * + * @return the healthy value. + */ + public Boolean healthy() { + return this.healthy; + } + + /** + * Set the healthy property: 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 the relationshipStatus property: Status of the mirror relationship. + * + * @return the relationshipStatus value. + */ + public RelationshipStatus relationshipStatus() { + return this.relationshipStatus; + } + + /** + * Set the relationshipStatus property: Status of the mirror relationship. + * + * @param relationshipStatus the relationshipStatus value to set. + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withRelationshipStatus(RelationshipStatus relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get the mirrorState property: The status of the replication. + * + * @return the mirrorState value. + */ + public MirrorState mirrorState() { + return this.mirrorState; + } + + /** + * Set the mirrorState property: The status of the replication. + * + * @param mirrorState the mirrorState value to set. + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withMirrorState(MirrorState mirrorState) { + this.mirrorState = mirrorState; + return this; + } + + /** + * Get the totalProgress property: The progress of the replication. + * + * @return the totalProgress value. + */ + public String totalProgress() { + return this.totalProgress; + } + + /** + * Set the totalProgress property: 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 the errorMessage property: Displays error message if the replication is in an error state. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotInner.java new file mode 100644 index 000000000000..015ecaa3f7c4 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotInner.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Snapshot of a Volume. */ +@JsonFlatten +@Fluent +public class SnapshotInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotInner.class); + + /* + * Resource location + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * UUID v4 used to identify the Snapshot + */ + @JsonProperty(value = "properties.snapshotId", access = JsonProperty.Access.WRITE_ONLY) + private String snapshotId; + + /* + * The creation date of the snapshot + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime created; + + /* + * Azure lifecycle management + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: 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 the snapshotId property: UUID v4 used to identify the Snapshot. + * + * @return the snapshotId value. + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Get the created property: The creation date of the snapshot. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model SnapshotInner")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyInner.java new file mode 100644 index 000000000000..3cb6f10d9b7e --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyInner.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.DailySchedule; +import com.azure.resourcemanager.netapp.models.HourlySchedule; +import com.azure.resourcemanager.netapp.models.MonthlySchedule; +import com.azure.resourcemanager.netapp.models.WeeklySchedule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Snapshot policy information. */ +@JsonFlatten +@Fluent +public class SnapshotPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotPolicyInner.class); + + /* + * Schedule for hourly snapshots + */ + @JsonProperty(value = "properties.hourlySchedule") + private HourlySchedule hourlySchedule; + + /* + * Schedule for daily snapshots + */ + @JsonProperty(value = "properties.dailySchedule") + private DailySchedule dailySchedule; + + /* + * Schedule for weekly snapshots + */ + @JsonProperty(value = "properties.weeklySchedule") + private WeeklySchedule weeklySchedule; + + /* + * 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 the hourlySchedule property: Schedule for hourly snapshots. + * + * @return the hourlySchedule value. + */ + public HourlySchedule hourlySchedule() { + return this.hourlySchedule; + } + + /** + * Set the hourlySchedule property: 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 the dailySchedule property: Schedule for daily snapshots. + * + * @return the dailySchedule value. + */ + public DailySchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set the dailySchedule property: 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 the weeklySchedule property: Schedule for weekly snapshots. + * + * @return the weeklySchedule value. + */ + public WeeklySchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set the weeklySchedule property: 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 the monthlySchedule property: Schedule for monthly snapshots. + * + * @return the monthlySchedule value. + */ + public MonthlySchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set the monthlySchedule property: 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 enabled property: The property to decide policy is enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: 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 the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public SnapshotPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SnapshotPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hourlySchedule() != null) { + hourlySchedule().validate(); + } + if (dailySchedule() != null) { + dailySchedule().validate(); + } + if (weeklySchedule() != null) { + weeklySchedule().validate(); + } + if (monthlySchedule() != null) { + monthlySchedule().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyVolumeListInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyVolumeListInner.java new file mode 100644 index 000000000000..bddd1d41ee7f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/SnapshotPolicyVolumeListInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Volumes associated with snapshot policy. */ +@Fluent +public final class SnapshotPolicyVolumeListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotPolicyVolumeListInner.class); + + /* + * List of volumes + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of volumes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VaultInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VaultInner.java new file mode 100644 index 000000000000..65700166ceb9 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VaultInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vault information. */ +@JsonFlatten +@Fluent +public class VaultInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultInner.class); + + /* + * Resource location + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * Vault Name + */ + @JsonProperty(value = "properties.vaultName") + private String vaultName; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: 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 the vaultName property: Vault Name. + * + * @return the vaultName value. + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Set the vaultName property: Vault Name. + * + * @param vaultName the vaultName value to set. + * @return the VaultInner object itself. + */ + public VaultInner withVaultName(String vaultName) { + this.vaultName = vaultName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model VaultInner")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VolumeInner.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VolumeInner.java new file mode 100644 index 000000000000..e5a1231a8c97 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/VolumeInner.java @@ -0,0 +1,622 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.models.MountTargetProperties; +import com.azure.resourcemanager.netapp.models.SecurityStyle; +import com.azure.resourcemanager.netapp.models.ServiceLevel; +import com.azure.resourcemanager.netapp.models.VolumePropertiesDataProtection; +import com.azure.resourcemanager.netapp.models.VolumePropertiesExportPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Volume resource. */ +@JsonFlatten +@Fluent +public class VolumeInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumeInner.class); + + /* + * Unique FileSystem Identifier. + */ + @JsonProperty(value = "properties.fileSystemId", access = JsonProperty.Access.WRITE_ONLY) + private String fileSystemId; + + /* + * A unique file path for the volume. Used when creating mount targets + */ + @JsonProperty(value = "properties.creationToken", required = true) + private String creationToken; + + /* + * The service level of the file system + */ + @JsonProperty(value = "properties.serviceLevel") + private ServiceLevel serviceLevel; + + /* + * 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; + + /* + * Set of export policy rules + */ + @JsonProperty(value = "properties.exportPolicy") + private VolumePropertiesExportPolicy exportPolicy; + + /* + * Set of protocol types, default NFSv3, CIFS fro SMB protocol + */ + @JsonProperty(value = "properties.protocolTypes") + private List protocolTypes; + + /* + * Azure lifecycle management + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * UUID v4 or resource identifier used to identify the Snapshot. + */ + @JsonProperty(value = "properties.snapshotId") + private String snapshotId; + + /* + * UUID v4 or resource identifier used to identify the Backup. + */ + @JsonProperty(value = "properties.backupId") + private String backupId; + + /* + * 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; + + /* + * List of mount targets + */ + @JsonProperty(value = "properties.mountTargets", access = JsonProperty.Access.WRITE_ONLY) + private List mountTargets; + + /* + * What type of volume is this + */ + @JsonProperty(value = "properties.volumeType") + private String volumeType; + + /* + * 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, default unix, defaults to ntfs for dual + * protocol or CIFS protocol + */ + @JsonProperty(value = "properties.securityStyle") + private SecurityStyle securityStyle; + + /* + * Enables encryption for in-flight smb3 data. Only applicable for + * SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or + * later + */ + @JsonProperty(value = "properties.smbEncryption") + private Boolean smbEncryption; + + /* + * Enables continuously available share property for smb volume. Only + * applicable for SMB volume + */ + @JsonProperty(value = "properties.smbContinuouslyAvailable") + private Boolean smbContinuouslyAvailable; + + /* + * Maximum throughput in Mibps that can be achieved by this volume + */ + @JsonProperty(value = "properties.throughputMibps") + private Float throughputMibps; + + /* + * Encryption Key Source. Possible values are: 'Microsoft.NetApp' + */ + @JsonProperty(value = "properties.encryptionKeySource") + private String encryptionKeySource; + + /** + * Get the fileSystemId property: Unique FileSystem Identifier. + * + * @return the fileSystemId value. + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Get the creationToken property: A unique file path for the volume. Used when creating mount targets. + * + * @return the creationToken value. + */ + public String creationToken() { + return this.creationToken; + } + + /** + * Set the creationToken property: 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 serviceLevel property: The service level of the file system. + * + * @return the serviceLevel value. + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the serviceLevel property: The service level of the file system. + * + * @param serviceLevel the serviceLevel value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get the usageThreshold property: 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 the usageThreshold property: 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 the exportPolicy property: Set of export policy rules. + * + * @return the exportPolicy value. + */ + public VolumePropertiesExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set the exportPolicy property: 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 the protocolTypes property: Set of protocol types, default NFSv3, CIFS fro SMB protocol. + * + * @return the protocolTypes value. + */ + public List protocolTypes() { + return this.protocolTypes; + } + + /** + * Set the protocolTypes property: Set of protocol types, default NFSv3, CIFS fro SMB protocol. + * + * @param protocolTypes the protocolTypes value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withProtocolTypes(List protocolTypes) { + this.protocolTypes = protocolTypes; + return this; + } + + /** + * Get the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the snapshotId property: UUID v4 or resource identifier used to identify the Snapshot. + * + * @return the snapshotId value. + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set the snapshotId property: 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 the backupId property: UUID v4 or resource identifier used to identify the Backup. + * + * @return the backupId value. + */ + public String backupId() { + return this.backupId; + } + + /** + * Set the backupId property: 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 the baremetalTenantId property: Unique Baremetal Tenant Identifier. + * + * @return the baremetalTenantId value. + */ + public String baremetalTenantId() { + return this.baremetalTenantId; + } + + /** + * Get the subnetId property: 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 subnetId property: 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 the mountTargets property: List of mount targets. + * + * @return the mountTargets value. + */ + public List mountTargets() { + return this.mountTargets; + } + + /** + * Get the volumeType property: What type of volume is this. + * + * @return the volumeType value. + */ + public String volumeType() { + return this.volumeType; + } + + /** + * Set the volumeType property: 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 the dataProtection property: DataProtection type volumes include an object containing details of the + * replication. + * + * @return the dataProtection value. + */ + public VolumePropertiesDataProtection dataProtection() { + return this.dataProtection; + } + + /** + * Set the dataProtection property: 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 the isRestoring property: Restoring. + * + * @return the isRestoring value. + */ + public Boolean isRestoring() { + return this.isRestoring; + } + + /** + * Set the isRestoring property: Restoring. + * + * @param isRestoring the isRestoring value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withIsRestoring(Boolean isRestoring) { + this.isRestoring = isRestoring; + return this; + } + + /** + * Get the snapshotDirectoryVisible property: 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 the snapshotDirectoryVisible property: 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 the kerberosEnabled property: 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 the kerberosEnabled property: 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 securityStyle property: The security style of volume, default unix, defaults to ntfs for dual protocol or + * CIFS protocol. + * + * @return the securityStyle value. + */ + public SecurityStyle securityStyle() { + return this.securityStyle; + } + + /** + * Set the securityStyle property: The security style of volume, default unix, defaults to ntfs for dual protocol or + * CIFS protocol. + * + * @param securityStyle the securityStyle value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withSecurityStyle(SecurityStyle securityStyle) { + this.securityStyle = securityStyle; + return this; + } + + /** + * Get the smbEncryption property: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol + * volume. To be used with swagger version 2020-08-01 or later. + * + * @return the smbEncryption value. + */ + public Boolean smbEncryption() { + return this.smbEncryption; + } + + /** + * Set the smbEncryption property: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol + * volume. To be used with swagger version 2020-08-01 or later. + * + * @param smbEncryption the smbEncryption value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withSmbEncryption(Boolean smbEncryption) { + this.smbEncryption = smbEncryption; + return this; + } + + /** + * Get the smbContinuouslyAvailable property: Enables continuously available share property for smb volume. Only + * applicable for SMB volume. + * + * @return the smbContinuouslyAvailable value. + */ + public Boolean smbContinuouslyAvailable() { + return this.smbContinuouslyAvailable; + } + + /** + * Set the smbContinuouslyAvailable property: Enables continuously available share property for smb volume. Only + * applicable for SMB volume. + * + * @param smbContinuouslyAvailable the smbContinuouslyAvailable value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withSmbContinuouslyAvailable(Boolean smbContinuouslyAvailable) { + this.smbContinuouslyAvailable = smbContinuouslyAvailable; + return this; + } + + /** + * Get the throughputMibps property: Maximum throughput in Mibps that can be achieved by this volume. + * + * @return the throughputMibps value. + */ + public Float throughputMibps() { + return this.throughputMibps; + } + + /** + * Set the throughputMibps property: Maximum throughput in Mibps that can be achieved by this volume. + * + * @param throughputMibps the throughputMibps value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withThroughputMibps(Float throughputMibps) { + this.throughputMibps = throughputMibps; + return this; + } + + /** + * Get the encryptionKeySource property: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + * + * @return the encryptionKeySource value. + */ + public String encryptionKeySource() { + return this.encryptionKeySource; + } + + /** + * Set the encryptionKeySource property: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + * + * @param encryptionKeySource the encryptionKeySource value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withEncryptionKeySource(String encryptionKeySource) { + this.encryptionKeySource = encryptionKeySource; + return this; + } + + /** {@inheritDoc} */ + @Override + public VolumeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VolumeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (creationToken() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property creationToken in model VolumeInner")); + } + if (exportPolicy() != null) { + exportPolicy().validate(); + } + if (subnetId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property subnetId in model VolumeInner")); + } + if (mountTargets() != null) { + mountTargets().forEach(e -> e.validate()); + } + if (dataProtection() != null) { + dataProtection().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/package-info.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/package-info.java new file mode 100644 index 000000000000..06d97c6bbef4 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for NetAppManagementClient. Microsoft NetApp Azure Resource Provider + * specification. + */ +package com.azure.resourcemanager.netapp.fluent.models; diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/package-info.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/package-info.java new file mode 100644 index 000000000000..96eacc2be004 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for NetAppManagementClient. Microsoft NetApp Azure Resource Provider + * specification. + */ +package com.azure.resourcemanager.netapp.fluent; diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsClientImpl.java new file mode 100644 index 000000000000..040941b956f9 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsClientImpl.java @@ -0,0 +1,665 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.AccountBackupsClient; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.fluent.models.BackupsListInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccountBackupsClient. */ +public final class AccountBackupsClientImpl implements AccountBackupsClient { + private final ClientLogger logger = new ClientLogger(AccountBackupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AccountBackupsService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of AccountBackupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountBackupsClientImpl(NetAppManagementClientImpl client) { + this.service = + RestProxy.create(AccountBackupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientAccountBackups to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface AccountBackupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/accountBackups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/accountBackups/{backupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("backupName") String backupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/accountBackups/{backupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("backupName") String backupName, + @QueryParam("api-version") String apiVersion, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupsListInner list(String resourceGroupName, String accountName) { + return listAsync(resourceGroupName, accountName).block(); + } + + /** + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String backupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String backupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String backupName) { + return getWithResponseAsync(resourceGroupName, accountName, backupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInner get(String resourceGroupName, String accountName, String backupName) { + return getAsync(resourceGroupName, accountName, backupName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String backupName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, backupName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String backupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String backupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String backupName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, backupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String backupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, backupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String backupName) { + return beginDeleteAsync(resourceGroupName, accountName, backupName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String backupName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, backupName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String backupName) { + return beginDeleteAsync(resourceGroupName, accountName, backupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String backupName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, backupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String backupName) { + deleteAsync(resourceGroupName, accountName, backupName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String backupName, Context context) { + deleteAsync(resourceGroupName, accountName, backupName, context).block(); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsImpl.java new file mode 100644 index 000000000000..bdc47bbb35be --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountBackupsImpl.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.AccountBackupsClient; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.fluent.models.BackupsListInner; +import com.azure.resourcemanager.netapp.models.AccountBackups; +import com.azure.resourcemanager.netapp.models.Backup; +import com.azure.resourcemanager.netapp.models.BackupsList; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AccountBackupsImpl implements AccountBackups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountBackupsImpl.class); + + private final AccountBackupsClient innerClient; + + private final NetAppManager serviceManager; + + public AccountBackupsImpl(AccountBackupsClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BackupsList list(String resourceGroupName, String accountName) { + BackupsListInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new BackupsListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupsListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Backup get(String resourceGroupName, String accountName, String backupName) { + BackupInner inner = this.serviceClient().get(resourceGroupName, accountName, backupName); + if (inner != null) { + return new BackupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String backupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, backupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String backupName) { + this.serviceClient().delete(resourceGroupName, accountName, backupName); + } + + public void delete(String resourceGroupName, String accountName, String backupName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, backupName, context); + } + + private AccountBackupsClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsClientImpl.java new file mode 100644 index 000000000000..07f9906bce22 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsClientImpl.java @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.AccountsClient; +import com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner; +import com.azure.resourcemanager.netapp.models.NetAppAccountList; +import com.azure.resourcemanager.netapp.models.NetAppAccountPatch; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccountsClient. */ +public final class AccountsClientImpl implements AccountsClient { + private final ClientLogger logger = new ClientLogger(AccountsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AccountsService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of AccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountsClientImpl(NetAppManagementClientImpl client) { + this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientAccounts to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface AccountsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetAppAccountInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetAppAccountPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetAppAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupAsync(resourceGroupName, accountName).block(); + } + + /** + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, NetAppAccountInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, NetAppAccountInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetAppAccountInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, NetAppAccountInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetAppAccountInner.class, NetAppAccountInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetAppAccountInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, NetAppAccountInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, accountName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetAppAccountInner.class, NetAppAccountInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetAppAccountInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, NetAppAccountInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetAppAccountInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, NetAppAccountInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, body, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, NetAppAccountInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, NetAppAccountInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetAppAccountInner createOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body) { + return createOrUpdateAsync(resourceGroupName, accountName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetAppAccountInner createOrUpdate( + String resourceGroupName, String accountName, NetAppAccountInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName) { + return beginDeleteAsync(resourceGroupName, accountName).getSyncPoller(); + } + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName) { + return beginDeleteAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName) { + deleteAsync(resourceGroupName, accountName).block(); + } + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, Context context) { + deleteAsync(resourceGroupName, accountName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, NetAppAccountPatch body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, NetAppAccountPatch body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetAppAccountInner> beginUpdateAsync( + String resourceGroupName, String accountName, NetAppAccountPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetAppAccountInner.class, NetAppAccountInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NetAppAccountInner> beginUpdateAsync( + String resourceGroupName, String accountName, NetAppAccountPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NetAppAccountInner.class, NetAppAccountInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetAppAccountInner> beginUpdate( + String resourceGroupName, String accountName, NetAppAccountPatch body) { + return beginUpdateAsync(resourceGroupName, accountName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NetAppAccountInner> beginUpdate( + String resourceGroupName, String accountName, NetAppAccountPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, accountName, body, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, NetAppAccountPatch body) { + return beginUpdateAsync(resourceGroupName, accountName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, NetAppAccountPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, accountName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetAppAccountInner update(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return updateAsync(resourceGroupName, accountName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return netApp account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetAppAccountInner update( + String resourceGroupName, String accountName, NetAppAccountPatch body, Context context) { + return updateAsync(resourceGroupName, accountName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsImpl.java new file mode 100644 index 000000000000..62fef3766faf --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/AccountsImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.AccountsClient; +import com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner; +import com.azure.resourcemanager.netapp.models.Accounts; +import com.azure.resourcemanager.netapp.models.NetAppAccount; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AccountsImpl implements Accounts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountsImpl.class); + + private final AccountsClient innerClient; + + private final NetAppManager serviceManager; + + public AccountsImpl(AccountsClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new NetAppAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new NetAppAccountImpl(inner1, this.manager())); + } + + public NetAppAccount getByResourceGroup(String resourceGroupName, String accountName) { + NetAppAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new NetAppAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetAppAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public void delete(String resourceGroupName, String accountName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, context); + } + + public NetAppAccount getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + this.delete(resourceGroupName, accountName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + this.delete(resourceGroupName, accountName, context); + } + + private AccountsClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + public NetAppAccountImpl define(String name) { + return new NetAppAccountImpl(name, this.manager()); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupImpl.java new file mode 100644 index 000000000000..3b43dd74505b --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.models.Backup; +import com.azure.resourcemanager.netapp.models.BackupPatch; +import java.time.OffsetDateTime; +import java.util.Map; + +public final class BackupImpl implements Backup, Backup.Definition, Backup.Update { + private BackupInner innerObject; + + private final NetAppManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public String backupId() { + return this.innerModel().backupId(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long size() { + return this.innerModel().size(); + } + + public String label() { + return this.innerModel().label(); + } + + public String backupType() { + return this.innerModel().backupType(); + } + + public String failureReason() { + return this.innerModel().failureReason(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BackupInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String poolName; + + private String volumeName; + + private String backupName; + + private BackupPatch updateBody; + + public BackupImpl withExistingVolume( + String resourceGroupName, String accountName, String poolName, String volumeName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.poolName = poolName; + this.volumeName = volumeName; + return this; + } + + public Backup create() { + this.innerObject = + serviceManager + .serviceClient() + .getBackups() + .create( + resourceGroupName, accountName, poolName, volumeName, backupName, this.innerModel(), Context.NONE); + return this; + } + + public Backup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackups() + .create(resourceGroupName, accountName, poolName, volumeName, backupName, this.innerModel(), context); + return this; + } + + BackupImpl(String name, NetAppManager serviceManager) { + this.innerObject = new BackupInner(); + this.serviceManager = serviceManager; + this.backupName = name; + } + + public BackupImpl update() { + this.updateBody = new BackupPatch(); + return this; + } + + public Backup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBackups() + .updateWithResponse( + resourceGroupName, accountName, poolName, volumeName, backupName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public Backup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackups() + .updateWithResponse( + resourceGroupName, accountName, poolName, volumeName, backupName, updateBody, context) + .getValue(); + return this; + } + + BackupImpl(BackupInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "netAppAccounts"); + this.poolName = Utils.getValueFromIdByName(innerObject.id(), "capacityPools"); + this.volumeName = Utils.getValueFromIdByName(innerObject.id(), "volumes"); + this.backupName = Utils.getValueFromIdByName(innerObject.id(), "backups"); + } + + public Backup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBackups() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, backupName, Context.NONE) + .getValue(); + return this; + } + + public Backup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackups() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, backupName, context) + .getValue(); + return this; + } + + public BackupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BackupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BackupImpl withLabel(String label) { + if (isInCreateMode()) { + this.innerModel().withLabel(label); + return this; + } else { + this.updateBody.withLabel(label); + return this; + } + } + + public BackupImpl withTags(Map tags) { + this.updateBody.withTags(tags); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesClientImpl.java new file mode 100644 index 000000000000..d1c22e7b10a9 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesClientImpl.java @@ -0,0 +1,1223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.BackupPoliciesClient; +import com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner; +import com.azure.resourcemanager.netapp.models.BackupPoliciesList; +import com.azure.resourcemanager.netapp.models.BackupPolicyPatch; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */ +public final class BackupPoliciesClientImpl implements BackupPoliciesClient { + private final ClientLogger logger = new ClientLogger(BackupPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupPoliciesService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of BackupPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupPoliciesClientImpl(NetAppManagementClientImpl client) { + this.service = + RestProxy.create(BackupPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientBackupPolicies to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface BackupPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/backupPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("backupPolicyName") String backupPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("backupPolicyName") String backupPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BackupPolicyInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("backupPolicyName") String backupPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BackupPolicyPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("backupPolicyName") String backupPolicyName, + @QueryParam("api-version") String apiVersion, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String backupPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String backupPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String backupPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, backupPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupPolicyInner get(String resourceGroupName, String accountName, String backupPolicyName) { + return getAsync(resourceGroupName, accountName, backupPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String backupPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, backupPolicyName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String backupPolicyName, + BackupPolicyInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BackupPolicyInner> beginCreateAsync( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, backupPolicyName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BackupPolicyInner.class, BackupPolicyInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BackupPolicyInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String backupPolicyName, + BackupPolicyInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, backupPolicyName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BackupPolicyInner.class, BackupPolicyInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BackupPolicyInner> beginCreate( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + return beginCreateAsync(resourceGroupName, accountName, backupPolicyName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BackupPolicyInner> beginCreate( + String resourceGroupName, + String accountName, + String backupPolicyName, + BackupPolicyInner body, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, backupPolicyName, body, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + return beginCreateAsync(resourceGroupName, accountName, backupPolicyName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String backupPolicyName, + BackupPolicyInner body, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, backupPolicyName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupPolicyInner create( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyInner body) { + return createAsync(resourceGroupName, accountName, backupPolicyName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupPolicyInner create( + String resourceGroupName, + String accountName, + String backupPolicyName, + BackupPolicyInner body, + Context context) { + return createAsync(resourceGroupName, accountName, backupPolicyName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String backupPolicyName, + BackupPolicyPatch body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body) { + return updateWithResponseAsync(resourceGroupName, accountName, backupPolicyName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupPolicyInner update( + String resourceGroupName, String accountName, String backupPolicyName, BackupPolicyPatch body) { + return updateAsync(resourceGroupName, accountName, backupPolicyName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String backupPolicyName, + BackupPolicyPatch body, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, backupPolicyName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String backupPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String backupPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (backupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + backupPolicyName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String backupPolicyName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, backupPolicyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String backupPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, backupPolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String backupPolicyName) { + return beginDeleteAsync(resourceGroupName, accountName, backupPolicyName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String backupPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, backupPolicyName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String backupPolicyName) { + return beginDeleteAsync(resourceGroupName, accountName, backupPolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String backupPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, backupPolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String backupPolicyName) { + deleteAsync(resourceGroupName, accountName, backupPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String backupPolicyName, Context context) { + deleteAsync(resourceGroupName, accountName, backupPolicyName, context).block(); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesImpl.java new file mode 100644 index 000000000000..3c32fd0793f2 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPoliciesImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.BackupPoliciesClient; +import com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner; +import com.azure.resourcemanager.netapp.models.BackupPolicies; +import com.azure.resourcemanager.netapp.models.BackupPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupPoliciesImpl implements BackupPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPoliciesImpl.class); + + private final BackupPoliciesClient innerClient; + + private final NetAppManager serviceManager; + + public BackupPoliciesImpl(BackupPoliciesClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new BackupPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return inner.mapPage(inner1 -> new BackupPolicyImpl(inner1, this.manager())); + } + + public BackupPolicy get(String resourceGroupName, String accountName, String backupPolicyName) { + BackupPolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, backupPolicyName); + if (inner != null) { + return new BackupPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String backupPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, backupPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String backupPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, backupPolicyName); + } + + public void delete(String resourceGroupName, String accountName, String backupPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, backupPolicyName, context); + } + + public BackupPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (backupPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, backupPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (backupPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, backupPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (backupPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + this.delete(resourceGroupName, accountName, backupPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies"); + if (backupPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); + } + this.delete(resourceGroupName, accountName, backupPolicyName, context); + } + + private BackupPoliciesClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + public BackupPolicyImpl define(String name) { + return new BackupPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPolicyImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPolicyImpl.java new file mode 100644 index 000000000000..ada5024751e8 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupPolicyImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner; +import com.azure.resourcemanager.netapp.models.BackupPolicy; +import com.azure.resourcemanager.netapp.models.BackupPolicyPatch; +import com.azure.resourcemanager.netapp.models.VolumeBackups; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BackupPolicyImpl implements BackupPolicy, BackupPolicy.Definition, BackupPolicy.Update { + private BackupPolicyInner innerObject; + + private final NetAppManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer dailyBackupsToKeep() { + return this.innerModel().dailyBackupsToKeep(); + } + + public Integer weeklyBackupsToKeep() { + return this.innerModel().weeklyBackupsToKeep(); + } + + public Integer monthlyBackupsToKeep() { + return this.innerModel().monthlyBackupsToKeep(); + } + + public Integer yearlyBackupsToKeep() { + return this.innerModel().yearlyBackupsToKeep(); + } + + public Integer volumesAssigned() { + return this.innerModel().volumesAssigned(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public List volumeBackups() { + List inner = this.innerModel().volumeBackups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BackupPolicyInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String backupPolicyName; + + private BackupPolicyPatch updateBody; + + public BackupPolicyImpl withExistingNetAppAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public BackupPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getBackupPolicies() + .create(resourceGroupName, accountName, backupPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public BackupPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackupPolicies() + .create(resourceGroupName, accountName, backupPolicyName, this.innerModel(), context); + return this; + } + + BackupPolicyImpl(String name, NetAppManager serviceManager) { + this.innerObject = new BackupPolicyInner(); + this.serviceManager = serviceManager; + this.backupPolicyName = name; + } + + public BackupPolicyImpl update() { + this.updateBody = new BackupPolicyPatch(); + return this; + } + + public BackupPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBackupPolicies() + .updateWithResponse(resourceGroupName, accountName, backupPolicyName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public BackupPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackupPolicies() + .updateWithResponse(resourceGroupName, accountName, backupPolicyName, updateBody, context) + .getValue(); + return this; + } + + BackupPolicyImpl(BackupPolicyInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "netAppAccounts"); + this.backupPolicyName = Utils.getValueFromIdByName(innerObject.id(), "backupPolicies"); + } + + public BackupPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBackupPolicies() + .getWithResponse(resourceGroupName, accountName, backupPolicyName, Context.NONE) + .getValue(); + return this; + } + + public BackupPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackupPolicies() + .getWithResponse(resourceGroupName, accountName, backupPolicyName, context) + .getValue(); + return this; + } + + public BackupPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BackupPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BackupPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public BackupPolicyImpl withDailyBackupsToKeep(Integer dailyBackupsToKeep) { + if (isInCreateMode()) { + this.innerModel().withDailyBackupsToKeep(dailyBackupsToKeep); + return this; + } else { + this.updateBody.withDailyBackupsToKeep(dailyBackupsToKeep); + return this; + } + } + + public BackupPolicyImpl withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep) { + if (isInCreateMode()) { + this.innerModel().withWeeklyBackupsToKeep(weeklyBackupsToKeep); + return this; + } else { + this.updateBody.withWeeklyBackupsToKeep(weeklyBackupsToKeep); + return this; + } + } + + public BackupPolicyImpl withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep) { + if (isInCreateMode()) { + this.innerModel().withMonthlyBackupsToKeep(monthlyBackupsToKeep); + return this; + } else { + this.updateBody.withMonthlyBackupsToKeep(monthlyBackupsToKeep); + return this; + } + } + + public BackupPolicyImpl withYearlyBackupsToKeep(Integer yearlyBackupsToKeep) { + if (isInCreateMode()) { + this.innerModel().withYearlyBackupsToKeep(yearlyBackupsToKeep); + return this; + } else { + this.updateBody.withYearlyBackupsToKeep(yearlyBackupsToKeep); + return this; + } + } + + public BackupPolicyImpl withVolumesAssigned(Integer volumesAssigned) { + if (isInCreateMode()) { + this.innerModel().withVolumesAssigned(volumesAssigned); + return this; + } else { + this.updateBody.withVolumesAssigned(volumesAssigned); + return this; + } + } + + public BackupPolicyImpl withEnabled(Boolean enabled) { + if (isInCreateMode()) { + this.innerModel().withEnabled(enabled); + return this; + } else { + this.updateBody.withEnabled(enabled); + return this; + } + } + + public BackupPolicyImpl withVolumeBackups(List volumeBackups) { + if (isInCreateMode()) { + this.innerModel().withVolumeBackups(volumeBackups); + return this; + } else { + this.updateBody.withVolumeBackups(volumeBackups); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsClientImpl.java new file mode 100644 index 000000000000..15bf9c2370f5 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsClientImpl.java @@ -0,0 +1,1498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.BackupsClient; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.fluent.models.BackupsListInner; +import com.azure.resourcemanager.netapp.models.BackupPatch; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackupsClient. */ +public final class BackupsClientImpl implements BackupsClient { + private final ClientLogger logger = new ClientLogger(BackupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackupsService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of BackupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupsClientImpl(NetAppManagementClientImpl client) { + this.service = RestProxy.create(BackupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientBackups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface BackupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("backupName") String backupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("backupName") String backupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BackupInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("backupName") String backupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BackupPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("backupName") String backupName, + @QueryParam("api-version") String apiVersion, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, poolName, volumeName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, poolName, volumeName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, poolName, volumeName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, poolName, volumeName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInner get( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return getAsync(resourceGroupName, accountName, poolName, volumeName, backupName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BackupInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BackupInner.class, BackupInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BackupInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BackupInner.class, BackupInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BackupInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BackupInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body) { + return createAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupInner body, + Context context) { + return createAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupPatch body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupPatch body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupPatch body) { + return updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + final BackupPatch body = null; + return updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInner update( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + final BackupPatch body = null; + return updateAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + BackupPatch body, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, body, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (backupName == null) { + return Mono.error(new IllegalArgumentException("Parameter backupName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + backupName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, backupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + deleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + deleteAsync(resourceGroupName, accountName, poolName, volumeName, backupName, context).block(); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsImpl.java new file mode 100644 index 000000000000..cf949ca289d6 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.BackupsClient; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.models.Backup; +import com.azure.resourcemanager.netapp.models.Backups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackupsImpl implements Backups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupsImpl.class); + + private final BackupsClient innerClient; + + private final NetAppManager serviceManager; + + public BackupsImpl(BackupsClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, poolName, volumeName); + return inner.mapPage(inner1 -> new BackupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, poolName, volumeName, context); + return inner.mapPage(inner1 -> new BackupImpl(inner1, this.manager())); + } + + public Backup get( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + BackupInner inner = this.serviceClient().get(resourceGroupName, accountName, poolName, volumeName, backupName); + if (inner != null) { + return new BackupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, backupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String accountName, String poolName, String volumeName, String backupName) { + this.serviceClient().delete(resourceGroupName, accountName, poolName, volumeName, backupName); + } + + public void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context) { + this.serviceClient().delete(resourceGroupName, accountName, poolName, volumeName, backupName, context); + } + + public Backup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String backupName = Utils.getValueFromIdByName(id, "backups"); + if (backupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backups'.", id))); + } + return this + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, backupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String backupName = Utils.getValueFromIdByName(id, "backups"); + if (backupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backups'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, poolName, volumeName, backupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String backupName = Utils.getValueFromIdByName(id, "backups"); + if (backupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backups'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, volumeName, backupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String backupName = Utils.getValueFromIdByName(id, "backups"); + if (backupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backups'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, volumeName, backupName, context); + } + + private BackupsClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + public BackupImpl define(String name) { + return new BackupImpl(name, this.manager()); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsListImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsListImpl.java new file mode 100644 index 000000000000..103d8cc2f812 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/BackupsListImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import com.azure.resourcemanager.netapp.fluent.models.BackupsListInner; +import com.azure.resourcemanager.netapp.models.Backup; +import com.azure.resourcemanager.netapp.models.BackupsList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class BackupsListImpl implements BackupsList { + private BackupsListInner innerObject; + + private final NetAppManager serviceManager; + + BackupsListImpl(BackupsListInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new BackupImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public BackupsListInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CapacityPoolImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CapacityPoolImpl.java new file mode 100644 index 000000000000..836c71b0b4a4 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CapacityPoolImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.CapacityPoolInner; +import com.azure.resourcemanager.netapp.models.CapacityPool; +import com.azure.resourcemanager.netapp.models.CapacityPoolPatch; +import com.azure.resourcemanager.netapp.models.QosType; +import com.azure.resourcemanager.netapp.models.ServiceLevel; +import java.util.Collections; +import java.util.Map; + +public final class CapacityPoolImpl implements CapacityPool, CapacityPool.Definition, CapacityPool.Update { + private CapacityPoolInner innerObject; + + private final NetAppManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String poolId() { + return this.innerModel().poolId(); + } + + public long size() { + return this.innerModel().size(); + } + + public ServiceLevel serviceLevel() { + return this.innerModel().serviceLevel(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Float totalThroughputMibps() { + return this.innerModel().totalThroughputMibps(); + } + + public Float utilizedThroughputMibps() { + return this.innerModel().utilizedThroughputMibps(); + } + + public QosType qosType() { + return this.innerModel().qosType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public CapacityPoolInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String poolName; + + private CapacityPoolPatch updateBody; + + public CapacityPoolImpl withExistingNetAppAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public CapacityPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getPools() + .createOrUpdate(resourceGroupName, accountName, poolName, this.innerModel(), Context.NONE); + return this; + } + + public CapacityPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPools() + .createOrUpdate(resourceGroupName, accountName, poolName, this.innerModel(), context); + return this; + } + + CapacityPoolImpl(String name, NetAppManager serviceManager) { + this.innerObject = new CapacityPoolInner(); + this.serviceManager = serviceManager; + this.poolName = name; + } + + public CapacityPoolImpl update() { + this.updateBody = new CapacityPoolPatch(); + return this; + } + + public CapacityPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPools() + .update(resourceGroupName, accountName, poolName, updateBody, Context.NONE); + return this; + } + + public CapacityPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPools() + .update(resourceGroupName, accountName, poolName, updateBody, context); + return this; + } + + CapacityPoolImpl(CapacityPoolInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "netAppAccounts"); + this.poolName = Utils.getValueFromIdByName(innerObject.id(), "capacityPools"); + } + + public CapacityPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPools() + .getWithResponse(resourceGroupName, accountName, poolName, Context.NONE) + .getValue(); + return this; + } + + public CapacityPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPools() + .getWithResponse(resourceGroupName, accountName, poolName, context) + .getValue(); + return this; + } + + public CapacityPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CapacityPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CapacityPoolImpl withSize(long size) { + this.innerModel().withSize(size); + return this; + } + + public CapacityPoolImpl withServiceLevel(ServiceLevel serviceLevel) { + this.innerModel().withServiceLevel(serviceLevel); + return this; + } + + public CapacityPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public CapacityPoolImpl withQosType(QosType qosType) { + if (isInCreateMode()) { + this.innerModel().withQosType(qosType); + return this; + } else { + this.updateBody.withQosType(qosType); + return this; + } + } + + public CapacityPoolImpl withSize(Long size) { + this.updateBody.withSize(size); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CheckAvailabilityResponseImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CheckAvailabilityResponseImpl.java new file mode 100644 index 000000000000..ec2c7a7816e9 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/CheckAvailabilityResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.CheckAvailabilityResponseInner; +import com.azure.resourcemanager.netapp.models.CheckAvailabilityResponse; +import com.azure.resourcemanager.netapp.models.InAvailabilityReasonType; + +public final class CheckAvailabilityResponseImpl implements CheckAvailabilityResponse { + private CheckAvailabilityResponseInner innerObject; + + private final NetAppManager serviceManager; + + CheckAvailabilityResponseImpl(CheckAvailabilityResponseInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isAvailable() { + return this.innerModel().isAvailable(); + } + + public InAvailabilityReasonType reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckAvailabilityResponseInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppAccountImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppAccountImpl.java new file mode 100644 index 000000000000..c9133b803339 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppAccountImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner; +import com.azure.resourcemanager.netapp.models.AccountEncryption; +import com.azure.resourcemanager.netapp.models.ActiveDirectory; +import com.azure.resourcemanager.netapp.models.NetAppAccount; +import com.azure.resourcemanager.netapp.models.NetAppAccountPatch; +import com.azure.resourcemanager.netapp.models.SystemData; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetAppAccountImpl implements NetAppAccount, NetAppAccount.Definition, NetAppAccount.Update { + private NetAppAccountInner innerObject; + + private final NetAppManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public List activeDirectories() { + List inner = this.innerModel().activeDirectories(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AccountEncryption encryption() { + return this.innerModel().encryption(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetAppAccountInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private NetAppAccountPatch updateBody; + + public NetAppAccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetAppAccount create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .createOrUpdate(resourceGroupName, accountName, this.innerModel(), Context.NONE); + return this; + } + + public NetAppAccount create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .createOrUpdate(resourceGroupName, accountName, this.innerModel(), context); + return this; + } + + NetAppAccountImpl(String name, NetAppManager serviceManager) { + this.innerObject = new NetAppAccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + } + + public NetAppAccountImpl update() { + this.updateBody = new NetAppAccountPatch(); + return this; + } + + public NetAppAccount apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .update(resourceGroupName, accountName, updateBody, Context.NONE); + return this; + } + + public NetAppAccount apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getAccounts().update(resourceGroupName, accountName, updateBody, context); + return this; + } + + NetAppAccountImpl(NetAppAccountInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "netAppAccounts"); + } + + public NetAppAccount refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public NetAppAccount refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public NetAppAccountImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetAppAccountImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetAppAccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public NetAppAccountImpl withActiveDirectories(List activeDirectories) { + if (isInCreateMode()) { + this.innerModel().withActiveDirectories(activeDirectories); + return this; + } else { + this.updateBody.withActiveDirectories(activeDirectories); + return this; + } + } + + public NetAppAccountImpl withEncryption(AccountEncryption encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateBody.withEncryption(encryption); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientBuilder.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientBuilder.java new file mode 100644 index 000000000000..15875b653aa3 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the NetAppManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {NetAppManagementClientImpl.class}) +public final class NetAppManagementClientBuilder { + /* + * Subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String 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 NetAppManagementClientBuilder. + */ + public NetAppManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the NetAppManagementClientBuilder. + */ + public NetAppManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the NetAppManagementClientBuilder. + */ + public NetAppManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the NetAppManagementClientBuilder. + */ + public NetAppManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the NetAppManagementClientBuilder. + */ + public NetAppManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the NetAppManagementClientBuilder. + */ + public NetAppManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NetAppManagementClientImpl with the provided parameters. + * + * @return an instance of NetAppManagementClientImpl. + */ + public NetAppManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + NetAppManagementClientImpl client = + new NetAppManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientImpl.java new file mode 100644 index 000000000000..4d35dd0da7a5 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppManagementClientImpl.java @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.netapp.fluent.AccountBackupsClient; +import com.azure.resourcemanager.netapp.fluent.AccountsClient; +import com.azure.resourcemanager.netapp.fluent.BackupPoliciesClient; +import com.azure.resourcemanager.netapp.fluent.BackupsClient; +import com.azure.resourcemanager.netapp.fluent.NetAppManagementClient; +import com.azure.resourcemanager.netapp.fluent.NetAppResourcesClient; +import com.azure.resourcemanager.netapp.fluent.OperationsClient; +import com.azure.resourcemanager.netapp.fluent.PoolsClient; +import com.azure.resourcemanager.netapp.fluent.SnapshotPoliciesClient; +import com.azure.resourcemanager.netapp.fluent.SnapshotsClient; +import com.azure.resourcemanager.netapp.fluent.VaultsClient; +import com.azure.resourcemanager.netapp.fluent.VolumesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the NetAppManagementClientImpl type. */ +@ServiceClient(builder = NetAppManagementClientBuilder.class) +public final class NetAppManagementClientImpl implements NetAppManagementClient { + private final ClientLogger logger = new ClientLogger(NetAppManagementClientImpl.class); + + /** + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final 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 getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The NetAppResourcesClient object to access its operations. */ + private final NetAppResourcesClient netAppResources; + + /** + * Gets the NetAppResourcesClient object to access its operations. + * + * @return the NetAppResourcesClient object. + */ + public NetAppResourcesClient getNetAppResources() { + return this.netAppResources; + } + + /** The AccountsClient object to access its operations. */ + private final AccountsClient accounts; + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + public AccountsClient getAccounts() { + return this.accounts; + } + + /** The PoolsClient object to access its operations. */ + private final PoolsClient pools; + + /** + * Gets the PoolsClient object to access its operations. + * + * @return the PoolsClient object. + */ + public PoolsClient getPools() { + return this.pools; + } + + /** The VolumesClient object to access its operations. */ + private final VolumesClient volumes; + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + public VolumesClient getVolumes() { + return this.volumes; + } + + /** The SnapshotsClient object to access its operations. */ + private final SnapshotsClient snapshots; + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + public SnapshotsClient getSnapshots() { + return this.snapshots; + } + + /** The SnapshotPoliciesClient object to access its operations. */ + private final SnapshotPoliciesClient snapshotPolicies; + + /** + * Gets the SnapshotPoliciesClient object to access its operations. + * + * @return the SnapshotPoliciesClient object. + */ + public SnapshotPoliciesClient getSnapshotPolicies() { + return this.snapshotPolicies; + } + + /** The AccountBackupsClient object to access its operations. */ + private final AccountBackupsClient accountBackups; + + /** + * Gets the AccountBackupsClient object to access its operations. + * + * @return the AccountBackupsClient object. + */ + public AccountBackupsClient getAccountBackups() { + return this.accountBackups; + } + + /** The BackupsClient object to access its operations. */ + private final BackupsClient backups; + + /** + * Gets the BackupsClient object to access its operations. + * + * @return the BackupsClient object. + */ + public BackupsClient getBackups() { + return this.backups; + } + + /** The BackupPoliciesClient object to access its operations. */ + private final BackupPoliciesClient backupPolicies; + + /** + * Gets the BackupPoliciesClient object to access its operations. + * + * @return the BackupPoliciesClient object. + */ + public BackupPoliciesClient getBackupPolicies() { + return this.backupPolicies; + } + + /** The VaultsClient object to access its operations. */ + private final VaultsClient vaults; + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + public VaultsClient getVaults() { + return this.vaults; + } + + /** + * Initializes an instance of NetAppManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + NetAppManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-11-01"; + this.operations = new OperationsClientImpl(this); + this.netAppResources = new NetAppResourcesClientImpl(this); + this.accounts = new AccountsClientImpl(this); + this.pools = new PoolsClientImpl(this); + this.volumes = new VolumesClientImpl(this); + this.snapshots = new SnapshotsClientImpl(this); + this.snapshotPolicies = new SnapshotPoliciesClientImpl(this); + this.accountBackups = new AccountBackupsClientImpl(this); + this.backups = new BackupsClientImpl(this); + this.backupPolicies = new BackupPoliciesClientImpl(this); + this.vaults = new VaultsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesClientImpl.java new file mode 100644 index 000000000000..30034fde3a9e --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesClientImpl.java @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.NetAppResourcesClient; +import com.azure.resourcemanager.netapp.fluent.models.CheckAvailabilityResponseInner; +import com.azure.resourcemanager.netapp.models.QuotaAvailabilityRequest; +import com.azure.resourcemanager.netapp.models.ResourceNameAvailabilityRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetAppResourcesClient. */ +public final class NetAppResourcesClientImpl implements NetAppResourcesClient { + private final ClientLogger logger = new ClientLogger(NetAppResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetAppResourcesService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of NetAppResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetAppResourcesClientImpl(NetAppManagementClientImpl client) { + this.service = + RestProxy.create(NetAppResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientNetAppResources to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface NetAppResourcesService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceNameAvailabilityRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkFilePathAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceNameAvailabilityRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkQuotaAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") QuotaAvailabilityRequest body, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, ResourceNameAvailabilityRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, ResourceNameAvailabilityRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, ResourceNameAvailabilityRequest body) { + return checkNameAvailabilityWithResponseAsync(location, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckAvailabilityResponseInner checkNameAvailability(String location, ResourceNameAvailabilityRequest body) { + return checkNameAvailabilityAsync(location, body).block(); + } + + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context) { + return checkNameAvailabilityWithResponseAsync(location, body, context).block(); + } + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkFilePathAvailabilityWithResponseAsync( + String location, ResourceNameAvailabilityRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkFilePathAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkFilePathAvailabilityWithResponseAsync( + String location, ResourceNameAvailabilityRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkFilePathAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkFilePathAvailabilityAsync( + String location, ResourceNameAvailabilityRequest body) { + return checkFilePathAvailabilityWithResponseAsync(location, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckAvailabilityResponseInner checkFilePathAvailability( + String location, ResourceNameAvailabilityRequest body) { + return checkFilePathAvailabilityAsync(location, body).block(); + } + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkFilePathAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context) { + return checkFilePathAvailabilityWithResponseAsync(location, body, context).block(); + } + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkQuotaAvailabilityWithResponseAsync( + String location, QuotaAvailabilityRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkQuotaAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkQuotaAvailabilityWithResponseAsync( + String location, QuotaAvailabilityRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkQuotaAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkQuotaAvailabilityAsync( + String location, QuotaAvailabilityRequest body) { + return checkQuotaAvailabilityWithResponseAsync(location, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckAvailabilityResponseInner checkQuotaAvailability(String location, QuotaAvailabilityRequest body) { + return checkQuotaAvailabilityAsync(location, body).block(); + } + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkQuotaAvailabilityWithResponse( + String location, QuotaAvailabilityRequest body, Context context) { + return checkQuotaAvailabilityWithResponseAsync(location, body, context).block(); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesImpl.java new file mode 100644 index 000000000000..227342c4828d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/NetAppResourcesImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.NetAppResourcesClient; +import com.azure.resourcemanager.netapp.fluent.models.CheckAvailabilityResponseInner; +import com.azure.resourcemanager.netapp.models.CheckAvailabilityResponse; +import com.azure.resourcemanager.netapp.models.NetAppResources; +import com.azure.resourcemanager.netapp.models.QuotaAvailabilityRequest; +import com.azure.resourcemanager.netapp.models.ResourceNameAvailabilityRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetAppResourcesImpl implements NetAppResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetAppResourcesImpl.class); + + private final NetAppResourcesClient innerClient; + + private final NetAppManager serviceManager; + + public NetAppResourcesImpl(NetAppResourcesClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckAvailabilityResponse checkNameAvailability(String location, ResourceNameAvailabilityRequest body) { + CheckAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(location, body); + if (inner != null) { + return new CheckAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckAvailabilityResponse checkFilePathAvailability(String location, ResourceNameAvailabilityRequest body) { + CheckAvailabilityResponseInner inner = this.serviceClient().checkFilePathAvailability(location, body); + if (inner != null) { + return new CheckAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkFilePathAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context) { + Response inner = + this.serviceClient().checkFilePathAvailabilityWithResponse(location, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckAvailabilityResponse checkQuotaAvailability(String location, QuotaAvailabilityRequest body) { + CheckAvailabilityResponseInner inner = this.serviceClient().checkQuotaAvailability(location, body); + if (inner != null) { + return new CheckAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkQuotaAvailabilityWithResponse( + String location, QuotaAvailabilityRequest body, Context context) { + Response inner = + this.serviceClient().checkQuotaAvailabilityWithResponse(location, body, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private NetAppResourcesClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationImpl.java new file mode 100644 index 000000000000..507d9a346ddb --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.OperationInner; +import com.azure.resourcemanager.netapp.models.Operation; +import com.azure.resourcemanager.netapp.models.OperationDisplay; +import com.azure.resourcemanager.netapp.models.ServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final NetAppManager serviceManager; + + OperationImpl(OperationInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..3366f8a70ea6 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsClientImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.OperationsClient; +import com.azure.resourcemanager.netapp.fluent.models.OperationInner; +import com.azure.resourcemanager.netapp.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(NetAppManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.NetApp/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsImpl.java new file mode 100644 index 000000000000..1b338a1860cf --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.OperationsClient; +import com.azure.resourcemanager.netapp.fluent.models.OperationInner; +import com.azure.resourcemanager.netapp.models.Operation; +import com.azure.resourcemanager.netapp.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final NetAppManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsClientImpl.java new file mode 100644 index 000000000000..109067d6979e --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsClientImpl.java @@ -0,0 +1,1377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.PoolsClient; +import com.azure.resourcemanager.netapp.fluent.models.CapacityPoolInner; +import com.azure.resourcemanager.netapp.models.CapacityPoolList; +import com.azure.resourcemanager.netapp.models.CapacityPoolPatch; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PoolsClient. */ +public final class PoolsClientImpl implements PoolsClient { + private final ClientLogger logger = new ClientLogger(PoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PoolsService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of PoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PoolsClientImpl(NetAppManagementClientImpl client) { + this.service = RestProxy.create(PoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientPools to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface PoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CapacityPoolInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CapacityPoolPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String poolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String poolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String poolName) { + return getWithResponseAsync(resourceGroupName, accountName, poolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityPoolInner get(String resourceGroupName, String accountName, String poolName) { + return getAsync(resourceGroupName, accountName, poolName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String poolName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, poolName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, accountName, poolName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CapacityPoolInner.class, CapacityPoolInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, accountName, poolName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CapacityPoolInner.class, CapacityPoolInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityPoolInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityPoolInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, body, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityPoolInner createOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return createOrUpdateAsync(resourceGroupName, accountName, poolName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityPoolInner createOrUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, poolName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityPoolInner> beginUpdateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, poolName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CapacityPoolInner.class, CapacityPoolInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CapacityPoolInner> beginUpdateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, poolName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CapacityPoolInner.class, CapacityPoolInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityPoolInner> beginUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CapacityPoolInner> beginUpdate( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, body, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, Context context) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityPoolInner update( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return updateAsync(resourceGroupName, accountName, poolName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return capacity pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapacityPoolInner update( + String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, Context context) { + return updateAsync(resourceGroupName, accountName, poolName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String poolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String poolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String poolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, poolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String poolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, poolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String poolName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String poolName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String poolName) { + deleteAsync(resourceGroupName, accountName, poolName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String poolName, Context context) { + deleteAsync(resourceGroupName, accountName, poolName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsImpl.java new file mode 100644 index 000000000000..edf446382130 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/PoolsImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.PoolsClient; +import com.azure.resourcemanager.netapp.fluent.models.CapacityPoolInner; +import com.azure.resourcemanager.netapp.models.CapacityPool; +import com.azure.resourcemanager.netapp.models.Pools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PoolsImpl implements Pools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PoolsImpl.class); + + private final PoolsClient innerClient; + + private final NetAppManager serviceManager; + + public PoolsImpl(PoolsClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new CapacityPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return inner.mapPage(inner1 -> new CapacityPoolImpl(inner1, this.manager())); + } + + public CapacityPool get(String resourceGroupName, String accountName, String poolName) { + CapacityPoolInner inner = this.serviceClient().get(resourceGroupName, accountName, poolName); + if (inner != null) { + return new CapacityPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String poolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, poolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapacityPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String poolName) { + this.serviceClient().delete(resourceGroupName, accountName, poolName); + } + + public void delete(String resourceGroupName, String accountName, String poolName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, poolName, context); + } + + public CapacityPool getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, poolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, poolName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, context); + } + + private PoolsClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + public CapacityPoolImpl define(String name) { + return new CapacityPoolImpl(name, this.manager()); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/ReplicationStatusImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/ReplicationStatusImpl.java new file mode 100644 index 000000000000..c5f6269476ba --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/ReplicationStatusImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.ReplicationStatusInner; +import com.azure.resourcemanager.netapp.models.MirrorState; +import com.azure.resourcemanager.netapp.models.RelationshipStatus; +import com.azure.resourcemanager.netapp.models.ReplicationStatus; + +public final class ReplicationStatusImpl implements ReplicationStatus { + private ReplicationStatusInner innerObject; + + private final NetAppManager serviceManager; + + ReplicationStatusImpl(ReplicationStatusInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean healthy() { + return this.innerModel().healthy(); + } + + public RelationshipStatus relationshipStatus() { + return this.innerModel().relationshipStatus(); + } + + public MirrorState mirrorState() { + return this.innerModel().mirrorState(); + } + + public String totalProgress() { + return this.innerModel().totalProgress(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public ReplicationStatusInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotImpl.java new file mode 100644 index 000000000000..84411572c37f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotInner; +import com.azure.resourcemanager.netapp.models.Snapshot; +import java.time.OffsetDateTime; + +public final class SnapshotImpl implements Snapshot, Snapshot.Definition { + private SnapshotInner innerObject; + + private final NetAppManager serviceManager; + + SnapshotImpl(SnapshotInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public String snapshotId() { + return this.innerModel().snapshotId(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SnapshotInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String poolName; + + private String volumeName; + + private String snapshotName; + + 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; + } + + public Snapshot create() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .create( + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.innerModel(), + Context.NONE); + return this; + } + + public Snapshot create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .create(resourceGroupName, accountName, poolName, volumeName, snapshotName, this.innerModel(), context); + return this; + } + + SnapshotImpl(String name, NetAppManager serviceManager) { + this.innerObject = new SnapshotInner(); + this.serviceManager = serviceManager; + this.snapshotName = name; + } + + public Snapshot refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, snapshotName, Context.NONE) + .getValue(); + return this; + } + + public Snapshot refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, snapshotName, context) + .getValue(); + return this; + } + + public SnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesClientImpl.java new file mode 100644 index 000000000000..16263cbfb727 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesClientImpl.java @@ -0,0 +1,1411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.SnapshotPoliciesClient; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyInner; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyVolumeListInner; +import com.azure.resourcemanager.netapp.models.SnapshotPoliciesList; +import com.azure.resourcemanager.netapp.models.SnapshotPolicyPatch; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SnapshotPoliciesClient. */ +public final class SnapshotPoliciesClientImpl implements SnapshotPoliciesClient { + private final ClientLogger logger = new ClientLogger(SnapshotPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SnapshotPoliciesService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of SnapshotPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnapshotPoliciesClientImpl(NetAppManagementClientImpl client) { + this.service = + RestProxy.create(SnapshotPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientSnapshotPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface SnapshotPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/snapshotPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("snapshotPolicyName") String snapshotPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("snapshotPolicyName") String snapshotPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SnapshotPolicyInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("snapshotPolicyName") String snapshotPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SnapshotPolicyPatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("snapshotPolicyName") String snapshotPolicyName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVolumes( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("snapshotPolicyName") String snapshotPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String snapshotPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotPolicyInner get(String resourceGroupName, String accountName, String snapshotPolicyName) { + return getAsync(resourceGroupName, accountName, snapshotPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner body) { + return createWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotPolicyInner create( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyInner body) { + return createAsync(resourceGroupName, accountName, snapshotPolicyName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyInner body, + Context context) { + return createWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyPatch body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotPolicyInner> beginUpdateAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SnapshotPolicyInner.class, + SnapshotPolicyInner.class, + Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotPolicyInner> beginUpdateAsync( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyPatch body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotPolicyInner.class, SnapshotPolicyInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotPolicyInner> beginUpdate( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + return beginUpdateAsync(resourceGroupName, accountName, snapshotPolicyName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotPolicyInner> beginUpdate( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyPatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, snapshotPolicyName, body, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + return beginUpdateAsync(resourceGroupName, accountName, snapshotPolicyName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyPatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, snapshotPolicyName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotPolicyInner update( + String resourceGroupName, String accountName, String snapshotPolicyName, SnapshotPolicyPatch body) { + return updateAsync(resourceGroupName, accountName, snapshotPolicyName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotPolicyInner update( + String resourceGroupName, + String accountName, + String snapshotPolicyName, + SnapshotPolicyPatch body, + Context context) { + return updateAsync(resourceGroupName, accountName, snapshotPolicyName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String snapshotPolicyName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String snapshotPolicyName) { + return beginDeleteAsync(resourceGroupName, accountName, snapshotPolicyName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, snapshotPolicyName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String snapshotPolicyName) { + return beginDeleteAsync(resourceGroupName, accountName, snapshotPolicyName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, snapshotPolicyName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String snapshotPolicyName) { + deleteAsync(resourceGroupName, accountName, snapshotPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + deleteAsync(resourceGroupName, accountName, snapshotPolicyName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVolumesWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVolumes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVolumesWithResponseAsync( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (snapshotPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter snapshotPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVolumes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + snapshotPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listVolumesAsync( + String resourceGroupName, String accountName, String snapshotPolicyName) { + return listVolumesWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotPolicyVolumeListInner listVolumes( + String resourceGroupName, String accountName, String snapshotPolicyName) { + return listVolumesAsync(resourceGroupName, accountName, snapshotPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listVolumesWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + return listVolumesWithResponseAsync(resourceGroupName, accountName, snapshotPolicyName, context).block(); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesImpl.java new file mode 100644 index 000000000000..8407308c94c6 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPoliciesImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.SnapshotPoliciesClient; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyInner; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyVolumeListInner; +import com.azure.resourcemanager.netapp.models.SnapshotPolicies; +import com.azure.resourcemanager.netapp.models.SnapshotPolicy; +import com.azure.resourcemanager.netapp.models.SnapshotPolicyVolumeList; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SnapshotPoliciesImpl implements SnapshotPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotPoliciesImpl.class); + + private final SnapshotPoliciesClient innerClient; + + private final NetAppManager serviceManager; + + public SnapshotPoliciesImpl(SnapshotPoliciesClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new SnapshotPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return inner.mapPage(inner1 -> new SnapshotPolicyImpl(inner1, this.manager())); + } + + public SnapshotPolicy get(String resourceGroupName, String accountName, String snapshotPolicyName) { + SnapshotPolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, snapshotPolicyName); + if (inner != null) { + return new SnapshotPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, snapshotPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SnapshotPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String snapshotPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, snapshotPolicyName); + } + + public void delete(String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, snapshotPolicyName, context); + } + + public SnapshotPolicyVolumeList listVolumes( + String resourceGroupName, String accountName, String snapshotPolicyName) { + SnapshotPolicyVolumeListInner inner = + this.serviceClient().listVolumes(resourceGroupName, accountName, snapshotPolicyName); + if (inner != null) { + return new SnapshotPolicyVolumeListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listVolumesWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context) { + Response inner = + this.serviceClient().listVolumesWithResponse(resourceGroupName, accountName, snapshotPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SnapshotPolicyVolumeListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SnapshotPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String snapshotPolicyName = Utils.getValueFromIdByName(id, "snapshotPolicies"); + if (snapshotPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'snapshotPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, snapshotPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String snapshotPolicyName = Utils.getValueFromIdByName(id, "snapshotPolicies"); + if (snapshotPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'snapshotPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, snapshotPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String snapshotPolicyName = Utils.getValueFromIdByName(id, "snapshotPolicies"); + if (snapshotPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'snapshotPolicies'.", id))); + } + this.delete(resourceGroupName, accountName, snapshotPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String snapshotPolicyName = Utils.getValueFromIdByName(id, "snapshotPolicies"); + if (snapshotPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'snapshotPolicies'.", id))); + } + this.delete(resourceGroupName, accountName, snapshotPolicyName, context); + } + + private SnapshotPoliciesClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + public SnapshotPolicyImpl define(String name) { + return new SnapshotPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyImpl.java new file mode 100644 index 000000000000..3f1017119334 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyImpl.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyInner; +import com.azure.resourcemanager.netapp.models.DailySchedule; +import com.azure.resourcemanager.netapp.models.HourlySchedule; +import com.azure.resourcemanager.netapp.models.MonthlySchedule; +import com.azure.resourcemanager.netapp.models.SnapshotPolicy; +import com.azure.resourcemanager.netapp.models.SnapshotPolicyPatch; +import com.azure.resourcemanager.netapp.models.WeeklySchedule; +import java.util.Collections; +import java.util.Map; + +public final class SnapshotPolicyImpl implements SnapshotPolicy, SnapshotPolicy.Definition, SnapshotPolicy.Update { + private SnapshotPolicyInner innerObject; + + private final NetAppManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public HourlySchedule hourlySchedule() { + return this.innerModel().hourlySchedule(); + } + + public DailySchedule dailySchedule() { + return this.innerModel().dailySchedule(); + } + + public WeeklySchedule weeklySchedule() { + return this.innerModel().weeklySchedule(); + } + + public MonthlySchedule monthlySchedule() { + return this.innerModel().monthlySchedule(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SnapshotPolicyInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String snapshotPolicyName; + + private SnapshotPolicyPatch updateBody; + + public SnapshotPolicyImpl withExistingNetAppAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public SnapshotPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshotPolicies() + .createWithResponse(resourceGroupName, accountName, snapshotPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SnapshotPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshotPolicies() + .createWithResponse(resourceGroupName, accountName, snapshotPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + SnapshotPolicyImpl(String name, NetAppManager serviceManager) { + this.innerObject = new SnapshotPolicyInner(); + this.serviceManager = serviceManager; + this.snapshotPolicyName = name; + } + + public SnapshotPolicyImpl update() { + this.updateBody = new SnapshotPolicyPatch(); + return this; + } + + public SnapshotPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshotPolicies() + .update(resourceGroupName, accountName, snapshotPolicyName, updateBody, Context.NONE); + return this; + } + + public SnapshotPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshotPolicies() + .update(resourceGroupName, accountName, snapshotPolicyName, updateBody, context); + return this; + } + + SnapshotPolicyImpl(SnapshotPolicyInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "netAppAccounts"); + this.snapshotPolicyName = Utils.getValueFromIdByName(innerObject.id(), "snapshotPolicies"); + } + + public SnapshotPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshotPolicies() + .getWithResponse(resourceGroupName, accountName, snapshotPolicyName, Context.NONE) + .getValue(); + return this; + } + + public SnapshotPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshotPolicies() + .getWithResponse(resourceGroupName, accountName, snapshotPolicyName, context) + .getValue(); + return this; + } + + public SnapshotPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnapshotPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SnapshotPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public SnapshotPolicyImpl withHourlySchedule(HourlySchedule hourlySchedule) { + if (isInCreateMode()) { + this.innerModel().withHourlySchedule(hourlySchedule); + return this; + } else { + this.updateBody.withHourlySchedule(hourlySchedule); + return this; + } + } + + public SnapshotPolicyImpl withDailySchedule(DailySchedule dailySchedule) { + if (isInCreateMode()) { + this.innerModel().withDailySchedule(dailySchedule); + return this; + } else { + this.updateBody.withDailySchedule(dailySchedule); + return this; + } + } + + public SnapshotPolicyImpl withWeeklySchedule(WeeklySchedule weeklySchedule) { + if (isInCreateMode()) { + this.innerModel().withWeeklySchedule(weeklySchedule); + return this; + } else { + this.updateBody.withWeeklySchedule(weeklySchedule); + return this; + } + } + + public SnapshotPolicyImpl withMonthlySchedule(MonthlySchedule monthlySchedule) { + if (isInCreateMode()) { + this.innerModel().withMonthlySchedule(monthlySchedule); + return this; + } else { + this.updateBody.withMonthlySchedule(monthlySchedule); + return this; + } + } + + public SnapshotPolicyImpl withEnabled(Boolean enabled) { + if (isInCreateMode()) { + this.innerModel().withEnabled(enabled); + return this; + } else { + this.updateBody.withEnabled(enabled); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyVolumeListImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyVolumeListImpl.java new file mode 100644 index 000000000000..5e5fa159fddd --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotPolicyVolumeListImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyVolumeListInner; +import com.azure.resourcemanager.netapp.models.SnapshotPolicyVolumeList; +import java.util.Collections; +import java.util.List; + +public final class SnapshotPolicyVolumeListImpl implements SnapshotPolicyVolumeList { + private SnapshotPolicyVolumeListInner innerObject; + + private final NetAppManager serviceManager; + + SnapshotPolicyVolumeListImpl(SnapshotPolicyVolumeListInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SnapshotPolicyVolumeListInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsClientImpl.java new file mode 100644 index 000000000000..d42263b4832f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsClientImpl.java @@ -0,0 +1,1620 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.SnapshotsClient; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotInner; +import com.azure.resourcemanager.netapp.models.SnapshotsList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SnapshotsClient. */ +public final class SnapshotsClientImpl implements SnapshotsClient { + private final ClientLogger logger = new ClientLogger(SnapshotsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SnapshotsService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of SnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnapshotsClientImpl(NetAppManagementClientImpl client) { + this.service = + RestProxy.create(SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientSnapshots to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface SnapshotsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots" + + "/{snapshotName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots" + + "/{snapshotName}") + @ExpectedResponses({201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SnapshotInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots" + + "/{snapshotName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Object body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots" + + "/{snapshotName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, poolName, volumeName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, poolName, volumeName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, poolName, volumeName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, poolName, volumeName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner get( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return getAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, context) + .block(); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, Context.NONE); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, context); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body) + .getSyncPoller(); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context) + .getSyncPoller(); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body) { + return createAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).block(); + } + + /** + * 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 body Snapshot object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner create( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + SnapshotInner body, + Context context) { + return createAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginUpdateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SnapshotInner> beginUpdateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body) + .getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SnapshotInner> beginUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body) { + return updateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context) { + return updateAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + snapshotName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + deleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + deleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, context).block(); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsImpl.java new file mode 100644 index 000000000000..ed43376aef73 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/SnapshotsImpl.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.SnapshotsClient; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotInner; +import com.azure.resourcemanager.netapp.models.Snapshot; +import com.azure.resourcemanager.netapp.models.Snapshots; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SnapshotsImpl implements Snapshots { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotsImpl.class); + + private final SnapshotsClient innerClient; + + private final NetAppManager serviceManager; + + public SnapshotsImpl(SnapshotsClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, poolName, volumeName); + return inner.mapPage(inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, poolName, volumeName, context); + return inner.mapPage(inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public Snapshot get( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + SnapshotInner inner = + this.serviceClient().get(resourceGroupName, accountName, poolName, volumeName, snapshotName); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, snapshotName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SnapshotImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Snapshot update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body) { + SnapshotInner inner = + this.serviceClient().update(resourceGroupName, accountName, poolName, volumeName, snapshotName, body); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public Snapshot update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context) { + SnapshotInner inner = + this + .serviceClient() + .update(resourceGroupName, accountName, poolName, volumeName, snapshotName, body, context); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + this.serviceClient().delete(resourceGroupName, accountName, poolName, volumeName, snapshotName); + } + + public void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context) { + this.serviceClient().delete(resourceGroupName, accountName, poolName, volumeName, snapshotName, context); + } + + public Snapshot getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, snapshotName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, poolName, volumeName, snapshotName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, volumeName, snapshotName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + String snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, volumeName, snapshotName, context); + } + + private SnapshotsClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + public SnapshotImpl define(String name) { + return new SnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/Utils.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/Utils.java new file mode 100644 index 000000000000..a668c0a74f09 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/Utils.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultImpl.java new file mode 100644 index 000000000000..a982b0b68429 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.VaultInner; +import com.azure.resourcemanager.netapp.models.Vault; + +public final class VaultImpl implements Vault { + private VaultInner innerObject; + + private final NetAppManager serviceManager; + + VaultImpl(VaultInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public String vaultName() { + return this.innerModel().vaultName(); + } + + public VaultInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsClientImpl.java new file mode 100644 index 000000000000..ba690401012f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsClientImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.VaultsClient; +import com.azure.resourcemanager.netapp.fluent.models.VaultInner; +import com.azure.resourcemanager.netapp.models.VaultList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VaultsClient. */ +public final class VaultsClientImpl implements VaultsClient { + private final ClientLogger logger = new ClientLogger(VaultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VaultsService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of VaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VaultsClientImpl(NetAppManagementClientImpl client) { + this.service = RestProxy.create(VaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientVaults to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface VaultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/vaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsImpl.java new file mode 100644 index 000000000000..75ca9a1a6cfe --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VaultsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.VaultsClient; +import com.azure.resourcemanager.netapp.fluent.models.VaultInner; +import com.azure.resourcemanager.netapp.models.Vault; +import com.azure.resourcemanager.netapp.models.Vaults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VaultsImpl implements Vaults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultsImpl.class); + + private final VaultsClient innerClient; + + private final NetAppManager serviceManager; + + public VaultsImpl(VaultsClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return inner.mapPage(inner1 -> new VaultImpl(inner1, this.manager())); + } + + private VaultsClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumeImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumeImpl.java new file mode 100644 index 000000000000..aafffa6c202d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumeImpl.java @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.models.VolumeInner; +import com.azure.resourcemanager.netapp.models.AuthorizeRequest; +import com.azure.resourcemanager.netapp.models.BreakReplicationRequest; +import com.azure.resourcemanager.netapp.models.MountTargetProperties; +import com.azure.resourcemanager.netapp.models.PoolChangeRequest; +import com.azure.resourcemanager.netapp.models.SecurityStyle; +import com.azure.resourcemanager.netapp.models.ServiceLevel; +import com.azure.resourcemanager.netapp.models.Volume; +import com.azure.resourcemanager.netapp.models.VolumePatch; +import com.azure.resourcemanager.netapp.models.VolumePatchPropertiesDataProtection; +import com.azure.resourcemanager.netapp.models.VolumePatchPropertiesExportPolicy; +import com.azure.resourcemanager.netapp.models.VolumePropertiesDataProtection; +import com.azure.resourcemanager.netapp.models.VolumePropertiesExportPolicy; +import com.azure.resourcemanager.netapp.models.VolumeRevert; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VolumeImpl implements Volume, Volume.Definition, Volume.Update { + private VolumeInner innerObject; + + private final NetAppManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String fileSystemId() { + return this.innerModel().fileSystemId(); + } + + public String creationToken() { + return this.innerModel().creationToken(); + } + + public ServiceLevel serviceLevel() { + return this.innerModel().serviceLevel(); + } + + public long usageThreshold() { + return this.innerModel().usageThreshold(); + } + + public VolumePropertiesExportPolicy exportPolicy() { + return this.innerModel().exportPolicy(); + } + + public List protocolTypes() { + List inner = this.innerModel().protocolTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String snapshotId() { + return this.innerModel().snapshotId(); + } + + public String backupId() { + return this.innerModel().backupId(); + } + + public String baremetalTenantId() { + return this.innerModel().baremetalTenantId(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public List mountTargets() { + List inner = this.innerModel().mountTargets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String volumeType() { + return this.innerModel().volumeType(); + } + + public VolumePropertiesDataProtection dataProtection() { + return this.innerModel().dataProtection(); + } + + public Boolean isRestoring() { + return this.innerModel().isRestoring(); + } + + public Boolean snapshotDirectoryVisible() { + return this.innerModel().snapshotDirectoryVisible(); + } + + public Boolean kerberosEnabled() { + return this.innerModel().kerberosEnabled(); + } + + public SecurityStyle securityStyle() { + return this.innerModel().securityStyle(); + } + + public Boolean smbEncryption() { + return this.innerModel().smbEncryption(); + } + + public Boolean smbContinuouslyAvailable() { + return this.innerModel().smbContinuouslyAvailable(); + } + + public Float throughputMibps() { + return this.innerModel().throughputMibps(); + } + + public String encryptionKeySource() { + return this.innerModel().encryptionKeySource(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VolumeInner innerModel() { + return this.innerObject; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String poolName; + + private String volumeName; + + private VolumePatch updateBody; + + public VolumeImpl withExistingCapacityPool(String resourceGroupName, String accountName, String poolName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.poolName = poolName; + return this; + } + + public Volume create() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .createOrUpdate(resourceGroupName, accountName, poolName, volumeName, this.innerModel(), Context.NONE); + return this; + } + + public Volume create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .createOrUpdate(resourceGroupName, accountName, poolName, volumeName, this.innerModel(), context); + return this; + } + + VolumeImpl(String name, NetAppManager serviceManager) { + this.innerObject = new VolumeInner(); + this.serviceManager = serviceManager; + this.volumeName = name; + } + + public VolumeImpl update() { + this.updateBody = new VolumePatch(); + return this; + } + + public Volume apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .update(resourceGroupName, accountName, poolName, volumeName, updateBody, Context.NONE); + return this; + } + + public Volume apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .update(resourceGroupName, accountName, poolName, volumeName, updateBody, context); + return this; + } + + VolumeImpl(VolumeInner innerObject, NetAppManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "netAppAccounts"); + this.poolName = Utils.getValueFromIdByName(innerObject.id(), "capacityPools"); + this.volumeName = Utils.getValueFromIdByName(innerObject.id(), "volumes"); + } + + public Volume refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, Context.NONE) + .getValue(); + return this; + } + + public Volume refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getWithResponse(resourceGroupName, accountName, poolName, volumeName, context) + .getValue(); + return this; + } + + public void revert(VolumeRevert body) { + serviceManager.volumes().revert(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void revert(VolumeRevert body, Context context) { + serviceManager.volumes().revert(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public void breakReplication(BreakReplicationRequest body) { + serviceManager.volumes().breakReplication(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void breakReplication() { + serviceManager.volumes().breakReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void breakReplication(BreakReplicationRequest body, Context context) { + serviceManager.volumes().breakReplication(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public void resyncReplication() { + serviceManager.volumes().resyncReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void resyncReplication(Context context) { + serviceManager.volumes().resyncReplication(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void deleteReplication() { + serviceManager.volumes().deleteReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void deleteReplication(Context context) { + serviceManager.volumes().deleteReplication(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void authorizeReplication(AuthorizeRequest body) { + serviceManager.volumes().authorizeReplication(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void authorizeReplication(AuthorizeRequest body, Context context) { + serviceManager + .volumes() + .authorizeReplication(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public void reInitializeReplication() { + serviceManager.volumes().reInitializeReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void reInitializeReplication(Context context) { + serviceManager.volumes().reInitializeReplication(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void poolChange(PoolChangeRequest body) { + serviceManager.volumes().poolChange(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void poolChange(PoolChangeRequest body, Context context) { + serviceManager.volumes().poolChange(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public VolumeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VolumeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VolumeImpl withCreationToken(String creationToken) { + this.innerModel().withCreationToken(creationToken); + return this; + } + + public VolumeImpl withUsageThreshold(long usageThreshold) { + this.innerModel().withUsageThreshold(usageThreshold); + return this; + } + + public VolumeImpl withSubnetId(String subnetId) { + this.innerModel().withSubnetId(subnetId); + return this; + } + + public VolumeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public VolumeImpl withServiceLevel(ServiceLevel serviceLevel) { + if (isInCreateMode()) { + this.innerModel().withServiceLevel(serviceLevel); + return this; + } else { + this.updateBody.withServiceLevel(serviceLevel); + return this; + } + } + + public VolumeImpl withExportPolicy(VolumePropertiesExportPolicy exportPolicy) { + this.innerModel().withExportPolicy(exportPolicy); + return this; + } + + public VolumeImpl withProtocolTypes(List protocolTypes) { + this.innerModel().withProtocolTypes(protocolTypes); + return this; + } + + public VolumeImpl withSnapshotId(String snapshotId) { + this.innerModel().withSnapshotId(snapshotId); + return this; + } + + public VolumeImpl withBackupId(String backupId) { + this.innerModel().withBackupId(backupId); + return this; + } + + public VolumeImpl withVolumeType(String volumeType) { + this.innerModel().withVolumeType(volumeType); + return this; + } + + public VolumeImpl withDataProtection(VolumePropertiesDataProtection dataProtection) { + this.innerModel().withDataProtection(dataProtection); + return this; + } + + public VolumeImpl withIsRestoring(Boolean isRestoring) { + this.innerModel().withIsRestoring(isRestoring); + return this; + } + + public VolumeImpl withSnapshotDirectoryVisible(Boolean snapshotDirectoryVisible) { + this.innerModel().withSnapshotDirectoryVisible(snapshotDirectoryVisible); + return this; + } + + public VolumeImpl withKerberosEnabled(Boolean kerberosEnabled) { + this.innerModel().withKerberosEnabled(kerberosEnabled); + return this; + } + + public VolumeImpl withSecurityStyle(SecurityStyle securityStyle) { + this.innerModel().withSecurityStyle(securityStyle); + return this; + } + + public VolumeImpl withSmbEncryption(Boolean smbEncryption) { + this.innerModel().withSmbEncryption(smbEncryption); + return this; + } + + public VolumeImpl withSmbContinuouslyAvailable(Boolean smbContinuouslyAvailable) { + this.innerModel().withSmbContinuouslyAvailable(smbContinuouslyAvailable); + return this; + } + + public VolumeImpl withThroughputMibps(Float throughputMibps) { + if (isInCreateMode()) { + this.innerModel().withThroughputMibps(throughputMibps); + return this; + } else { + this.updateBody.withThroughputMibps(throughputMibps); + return this; + } + } + + public VolumeImpl withEncryptionKeySource(String encryptionKeySource) { + this.innerModel().withEncryptionKeySource(encryptionKeySource); + return this; + } + + public VolumeImpl withUsageThreshold(Long usageThreshold) { + this.updateBody.withUsageThreshold(usageThreshold); + return this; + } + + public VolumeImpl withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy) { + this.updateBody.withExportPolicy(exportPolicy); + return this; + } + + public VolumeImpl withDataProtection(VolumePatchPropertiesDataProtection dataProtection) { + this.updateBody.withDataProtection(dataProtection); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesClientImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesClientImpl.java new file mode 100644 index 000000000000..ace1a81d17a4 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesClientImpl.java @@ -0,0 +1,3980 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.netapp.fluent.VolumesClient; +import com.azure.resourcemanager.netapp.fluent.models.ReplicationStatusInner; +import com.azure.resourcemanager.netapp.fluent.models.VolumeInner; +import com.azure.resourcemanager.netapp.models.AuthorizeRequest; +import com.azure.resourcemanager.netapp.models.BreakReplicationRequest; +import com.azure.resourcemanager.netapp.models.PoolChangeRequest; +import com.azure.resourcemanager.netapp.models.VolumeList; +import com.azure.resourcemanager.netapp.models.VolumePatch; +import com.azure.resourcemanager.netapp.models.VolumeRevert; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VolumesClient. */ +public final class VolumesClientImpl implements VolumesClient { + private final ClientLogger logger = new ClientLogger(VolumesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VolumesService service; + + /** The service client containing this operation class. */ + private final NetAppManagementClientImpl client; + + /** + * Initializes an instance of VolumesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VolumesClientImpl(NetAppManagementClientImpl client) { + this.service = RestProxy.create(VolumesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetAppManagementClientVolumes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetAppManagementClie") + private interface VolumesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VolumeInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VolumePatch body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> revert( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VolumeRevert body, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> breakReplication( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BreakReplicationRequest body, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> replicationStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resyncReplication( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteReplication( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> authorizeReplication( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AuthorizeRequest body, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reInitializeReplication( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp" + + "/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> poolChange( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("poolName") String poolName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PoolChangeRequest body, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String poolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String poolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String poolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, poolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String poolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, poolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String poolName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, poolName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String poolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, poolName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner get(String resourceGroupName, String accountName, String poolName, String volumeName) { + return getAsync(resourceGroupName, accountName, poolName, volumeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VolumeInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VolumeInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner createOrUpdate( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return createOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner createOrUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumePatch body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VolumeInner> beginUpdateAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, VolumeInner> beginUpdateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumePatch body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumePatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumePatch body, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner update( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return updateAsync(resourceGroupName, accountName, poolName, volumeName, body).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volume resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumePatch body, + Context context) { + return updateAsync(resourceGroupName, accountName, poolName, volumeName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, poolName, volumeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String poolName, String volumeName) { + deleteAsync(resourceGroupName, accountName, poolName, volumeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + deleteAsync(resourceGroupName, accountName, poolName, volumeName, context).block(); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revertWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + return FluxUtil + .withContext( + context -> + service + .revert( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revertWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + context = this.client.mergeContext(context); + return service + .revert( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevertAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body) { + Mono>> mono = + revertWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevertAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + revertWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevert( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body) { + return beginRevertAsync(resourceGroupName, accountName, poolName, volumeName, body).getSyncPoller(); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevert( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context) { + return beginRevertAsync(resourceGroupName, accountName, poolName, volumeName, body, context).getSyncPoller(); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revertAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body) { + return beginRevertAsync(resourceGroupName, accountName, poolName, volumeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revertAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context) { + return beginRevertAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revert( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body) { + revertAsync(resourceGroupName, accountName, poolName, volumeName, body).block(); + } + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revert( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context) { + revertAsync(resourceGroupName, accountName, poolName, volumeName, body, context).block(); + } + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> breakReplicationWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + return FluxUtil + .withContext( + context -> + service + .breakReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> breakReplicationWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + context = this.client.mergeContext(context); + return service + .breakReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context); + } + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginBreakReplicationAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body) { + Mono>> mono = + breakReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginBreakReplicationAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + breakReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginBreakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body) { + return beginBreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).getSyncPoller(); + } + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginBreakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context) { + return beginBreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .getSyncPoller(); + } + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono breakReplicationAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body) { + return beginBreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono breakReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + final BreakReplicationRequest body = null; + return beginBreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono breakReplicationAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context) { + return beginBreakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void breakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body) { + breakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void breakReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + final BreakReplicationRequest body = null; + breakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).block(); + } + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void breakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context) { + breakReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> replicationStatusWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .replicationStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> replicationStatusWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .replicationStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono replicationStatusAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return replicationStatusWithResponseAsync(resourceGroupName, accountName, poolName, volumeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationStatusInner replicationStatus( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return replicationStatusAsync(resourceGroupName, accountName, poolName, volumeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response replicationStatusWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return replicationStatusWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resyncReplicationWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .resyncReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resyncReplicationWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .resyncReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResyncReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + Mono>> mono = + resyncReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResyncReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resyncReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resyncReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resyncReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginResyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + resyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + resyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteReplicationWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .deleteReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteReplicationWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .deleteReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + Mono>> mono = + deleteReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginDeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginDeleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + deleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + deleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context).block(); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> authorizeReplicationWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + return FluxUtil + .withContext( + context -> + service + .authorizeReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> authorizeReplicationWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + context = this.client.mergeContext(context); + return service + .authorizeReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginAuthorizeReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body) { + Mono>> mono = + authorizeReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginAuthorizeReplicationAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + authorizeReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginAuthorizeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body) { + return beginAuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body) + .getSyncPoller(); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginAuthorizeReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context) { + return beginAuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .getSyncPoller(); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono authorizeReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body) { + return beginAuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono authorizeReplicationAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context) { + return beginAuthorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void authorizeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body) { + authorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).block(); + } + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void authorizeReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context) { + authorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reInitializeReplicationWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .reInitializeReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reInitializeReplicationWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .reInitializeReplication( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReInitializeReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + Mono>> mono = + reInitializeReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReInitializeReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reInitializeReplicationWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reInitializeReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reInitializeReplicationAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + return beginReInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName) { + reInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + reInitializeReplicationAsync(resourceGroupName, accountName, poolName, volumeName, context).block(); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> poolChangeWithResponseAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + return FluxUtil + .withContext( + context -> + service + .poolChange( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> poolChangeWithResponseAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (poolName == null) { + return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + context = this.client.mergeContext(context); + return service + .poolChange( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + poolName, + volumeName, + this.client.getApiVersion(), + body, + context); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPoolChangeAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body) { + Mono>> mono = + poolChangeWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPoolChangeAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + poolChangeWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPoolChange( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body) { + return beginPoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).getSyncPoller(); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPoolChange( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context) { + return beginPoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .getSyncPoller(); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono poolChangeAsync( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body) { + return beginPoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono poolChangeAsync( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context) { + return beginPoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void poolChange( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body) { + poolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).block(); + } + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void poolChange( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context) { + poolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesImpl.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesImpl.java new file mode 100644 index 000000000000..2b53e36c9989 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/VolumesImpl.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.NetAppManager; +import com.azure.resourcemanager.netapp.fluent.VolumesClient; +import com.azure.resourcemanager.netapp.fluent.models.ReplicationStatusInner; +import com.azure.resourcemanager.netapp.fluent.models.VolumeInner; +import com.azure.resourcemanager.netapp.models.AuthorizeRequest; +import com.azure.resourcemanager.netapp.models.BreakReplicationRequest; +import com.azure.resourcemanager.netapp.models.PoolChangeRequest; +import com.azure.resourcemanager.netapp.models.ReplicationStatus; +import com.azure.resourcemanager.netapp.models.Volume; +import com.azure.resourcemanager.netapp.models.VolumeRevert; +import com.azure.resourcemanager.netapp.models.Volumes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VolumesImpl implements Volumes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumesImpl.class); + + private final VolumesClient innerClient; + + private final NetAppManager serviceManager; + + public VolumesImpl(VolumesClient innerClient, NetAppManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName, String poolName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, poolName); + return inner.mapPage(inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String poolName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, poolName, context); + return inner.mapPage(inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public Volume get(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumeInner inner = this.serviceClient().get(resourceGroupName, accountName, poolName, volumeName); + if (inner != null) { + return new VolumeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, poolName, volumeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VolumeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String poolName, String volumeName) { + this.serviceClient().delete(resourceGroupName, accountName, poolName, volumeName); + } + + public void delete( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void revert( + String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body) { + this.serviceClient().revert(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void revert( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context) { + this.serviceClient().revert(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public void breakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body) { + this.serviceClient().breakReplication(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void breakReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + this.serviceClient().breakReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void breakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context) { + this.serviceClient().breakReplication(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public ReplicationStatus replicationStatus( + String resourceGroupName, String accountName, String poolName, String volumeName) { + ReplicationStatusInner inner = + this.serviceClient().replicationStatus(resourceGroupName, accountName, poolName, volumeName); + if (inner != null) { + return new ReplicationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response replicationStatusWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + Response inner = + this + .serviceClient() + .replicationStatusWithResponse(resourceGroupName, accountName, poolName, volumeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + this.serviceClient().resyncReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void resyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + this.serviceClient().resyncReplication(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void deleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + this.serviceClient().deleteReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void deleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + this.serviceClient().deleteReplication(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void authorizeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body) { + this.serviceClient().authorizeReplication(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void authorizeReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context) { + this.serviceClient().authorizeReplication(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public void reInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName) { + this.serviceClient().reInitializeReplication(resourceGroupName, accountName, poolName, volumeName); + } + + public void reInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context) { + this.serviceClient().reInitializeReplication(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void poolChange( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body) { + this.serviceClient().poolChange(resourceGroupName, accountName, poolName, volumeName, body); + } + + public void poolChange( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context) { + this.serviceClient().poolChange(resourceGroupName, accountName, poolName, volumeName, body, context); + } + + public Volume getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, poolName, volumeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, poolName, volumeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, volumeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "netAppAccounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'netAppAccounts'.", id))); + } + String poolName = Utils.getValueFromIdByName(id, "capacityPools"); + if (poolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capacityPools'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + this.delete(resourceGroupName, accountName, poolName, volumeName, context); + } + + private VolumesClient serviceClient() { + return this.innerClient; + } + + private NetAppManager manager() { + return this.serviceManager; + } + + public VolumeImpl define(String name) { + return new VolumeImpl(name, this.manager()); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/package-info.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/package-info.java new file mode 100644 index 000000000000..7c6d62ef87c6 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for NetAppManagementClient. Microsoft NetApp Azure Resource Provider + * specification. + */ +package com.azure.resourcemanager.netapp.implementation; diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountBackups.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountBackups.java new file mode 100644 index 000000000000..0c8933176f17 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountBackups.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccountBackups. */ +public interface AccountBackups { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + BackupsList list(String resourceGroupName, String accountName); + + /** + * List all Backups for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + Backup get(String resourceGroupName, String accountName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backup for a Netapp Account. + */ + Response getWithResponse(String resourceGroupName, String accountName, String backupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String backupName, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountEncryption.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountEncryption.java new file mode 100644 index 000000000000..58949eb0f823 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AccountEncryption.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption settings. */ +@Fluent +public final class AccountEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountEncryption.class); + + /* + * Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + */ + @JsonProperty(value = "keySource") + private KeySource keySource; + + /** + * Get the keySource property: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + * + * @return the keySource value. + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + * + * @param keySource the keySource value to set. + * @return the AccountEncryption object itself. + */ + public AccountEncryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Accounts.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Accounts.java new file mode 100644 index 000000000000..e9466cf26b41 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Accounts.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Accounts. */ +public interface Accounts { + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of NetApp account resources. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + NetAppAccount getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String accountName); + + /** + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, Context context); + + /** + * Get the NetApp account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + NetAppAccount getById(String id); + + /** + * Get the NetApp account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the NetApp account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the specified NetApp account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the specified NetApp account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetAppAccount resource. + * + * @param name resource name. + * @return the first stage of the new NetAppAccount definition. + */ + NetAppAccount.DefinitionStages.Blank define(String name); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectory.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectory.java new file mode 100644 index 000000000000..df64aede95ce --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectory.java @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Active Directory. */ +@Fluent +public final class ActiveDirectory { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActiveDirectory.class); + + /* + * 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 + */ + @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; + + /* + * If enabled, AES encryption will be enabled for SMB communication. + */ + @JsonProperty(value = "aesEncryption") + private Boolean aesEncryption; + + /* + * Specifies whether or not the LDAP traffic needs to be signed. + */ + @JsonProperty(value = "ldapSigning") + private Boolean ldapSigning; + + /* + * Domain Users in the Active directory to be given SeSecurityPrivilege + * privilege (Needed for SMB Continuously available shares for SQL). A list + * of unique usernames without domain specifier + */ + @JsonProperty(value = "securityOperators") + private List securityOperators; + + /* + * Specifies whether or not the LDAP traffic needs to be secured via TLS. + */ + @JsonProperty(value = "ldapOverTLS") + private Boolean ldapOverTls; + + /** + * Get the activeDirectoryId property: Id of the Active Directory. + * + * @return the activeDirectoryId value. + */ + public String activeDirectoryId() { + return this.activeDirectoryId; + } + + /** + * Set the activeDirectoryId property: 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 the username property: Username of Active Directory domain administrator. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: 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 the password property: 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 the password property: 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 the domain property: Name of the Active Directory domain. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: 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 the dns property: 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 the dns property: 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 the status property: Status of the Active Directory. + * + * @return the status value. + */ + public ActiveDirectoryStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Any details in regards to the Status of the Active Directory. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the smbServerName property: 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 the smbServerName property: 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 organizationalUnit property: The Organizational Unit (OU) within the Windows Active Directory. + * + * @return the organizationalUnit value. + */ + public String organizationalUnit() { + return this.organizationalUnit; + } + + /** + * Set the organizationalUnit property: 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 site property: The Active Directory site the service will limit Domain Controller discovery to. + * + * @return the site value. + */ + public String site() { + return this.site; + } + + /** + * Set the site property: 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 the backupOperators property: 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 the backupOperators property: 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 the kdcIp property: 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 the kdcIp property: 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 the adName property: 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 the adName property: 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 the serverRootCACertificate property: 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 the serverRootCACertificate property: 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; + } + + /** + * Get the aesEncryption property: If enabled, AES encryption will be enabled for SMB communication. + * + * @return the aesEncryption value. + */ + public Boolean aesEncryption() { + return this.aesEncryption; + } + + /** + * Set the aesEncryption property: If enabled, AES encryption will be enabled for SMB communication. + * + * @param aesEncryption the aesEncryption value to set. + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withAesEncryption(Boolean aesEncryption) { + this.aesEncryption = aesEncryption; + return this; + } + + /** + * Get the ldapSigning property: Specifies whether or not the LDAP traffic needs to be signed. + * + * @return the ldapSigning value. + */ + public Boolean ldapSigning() { + return this.ldapSigning; + } + + /** + * Set the ldapSigning property: Specifies whether or not the LDAP traffic needs to be signed. + * + * @param ldapSigning the ldapSigning value to set. + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withLdapSigning(Boolean ldapSigning) { + this.ldapSigning = ldapSigning; + return this; + } + + /** + * Get the securityOperators property: Domain Users in the Active directory to be given SeSecurityPrivilege + * privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain + * specifier. + * + * @return the securityOperators value. + */ + public List securityOperators() { + return this.securityOperators; + } + + /** + * Set the securityOperators property: Domain Users in the Active directory to be given SeSecurityPrivilege + * privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain + * specifier. + * + * @param securityOperators the securityOperators value to set. + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withSecurityOperators(List securityOperators) { + this.securityOperators = securityOperators; + return this; + } + + /** + * Get the ldapOverTls property: Specifies whether or not the LDAP traffic needs to be secured via TLS. + * + * @return the ldapOverTls value. + */ + public Boolean ldapOverTls() { + return this.ldapOverTls; + } + + /** + * Set the ldapOverTls property: Specifies whether or not the LDAP traffic needs to be secured via TLS. + * + * @param ldapOverTls the ldapOverTls value to set. + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withLdapOverTls(Boolean ldapOverTls) { + this.ldapOverTls = ldapOverTls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectoryStatus.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectoryStatus.java new file mode 100644 index 000000000000..50504731acba --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ActiveDirectoryStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AuthorizeRequest.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AuthorizeRequest.java new file mode 100644 index 000000000000..29285c40434c --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/AuthorizeRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authorize request. */ +@Fluent +public final class AuthorizeRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizeRequest.class); + + /* + * Resource id of the remote volume + */ + @JsonProperty(value = "remoteVolumeResourceId") + private String remoteVolumeResourceId; + + /** + * Get the remoteVolumeResourceId property: Resource id of the remote volume. + * + * @return the remoteVolumeResourceId value. + */ + public String remoteVolumeResourceId() { + return this.remoteVolumeResourceId; + } + + /** + * Set the remoteVolumeResourceId property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backup.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backup.java new file mode 100644 index 000000000000..0373bc49d7db --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backup.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.BackupInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of Backup. */ +public interface Backup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the backupId property: UUID v4 used to identify the Backup. + * + * @return the backupId value. + */ + String backupId(); + + /** + * Gets the creationDate property: The creation date of the backup. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the size property: Size of backup. + * + * @return the size value. + */ + Long size(); + + /** + * Gets the label property: Label for backup. + * + * @return the label value. + */ + String label(); + + /** + * Gets the backupType property: Type of backup adhoc or scheduled. + * + * @return the backupType value. + */ + String backupType(); + + /** + * Gets the failureReason property: Failure reason. + * + * @return the failureReason value. + */ + String failureReason(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.BackupInner object. + * + * @return the inner object. + */ + BackupInner innerModel(); + + /** The entirety of the Backup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Backup definition stages. */ + interface DefinitionStages { + /** The first stage of the Backup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Backup definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Backup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingVolume( + String resourceGroupName, String accountName, String poolName, String volumeName); + } + /** + * The stage of the Backup definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithLabel { + /** + * Executes the create request. + * + * @return the created resource. + */ + Backup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Backup create(Context context); + } + /** The stage of the Backup definition allowing to specify label. */ + interface WithLabel { + /** + * Specifies the label property: Label for backup. + * + * @param label Label for backup. + * @return the next definition stage. + */ + WithCreate withLabel(String label); + } + } + /** + * Begins update for the Backup resource. + * + * @return the stage of resource update. + */ + Backup.Update update(); + + /** The template for Backup update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithLabel { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Backup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Backup apply(Context context); + } + /** The Backup update stages. */ + interface UpdateStages { + /** The stage of the Backup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Backup update allowing to specify label. */ + interface WithLabel { + /** + * Specifies the label property: Label for backup. + * + * @param label Label for backup. + * @return the next definition stage. + */ + Update withLabel(String label); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Backup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Backup refresh(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPatch.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPatch.java new file mode 100644 index 000000000000..e2da0a4bac75 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPatch.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Backup patch. */ +@JsonFlatten +@Fluent +public class BackupPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPatch.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * UUID v4 used to identify the Backup + */ + @JsonProperty(value = "properties.backupId", access = JsonProperty.Access.WRITE_ONLY) + private String backupId; + + /* + * The creation date of the backup + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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; + + /* + * Failure reason + */ + @JsonProperty(value = "properties.failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 the backupId property: UUID v4 used to identify the Backup. + * + * @return the backupId value. + */ + public String backupId() { + return this.backupId; + } + + /** + * Get the creationDate property: The creation date of the backup. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the size property: Size of backup. + * + * @return the size value. + */ + public Long size() { + return this.size; + } + + /** + * Get the label property: Label for backup. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: 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 the backupType property: Type of backup adhoc or scheduled. + * + * @return the backupType value. + */ + public String backupType() { + return this.backupType; + } + + /** + * Get the failureReason property: Failure reason. + * + * @return the failureReason value. + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicies.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicies.java new file mode 100644 index 000000000000..615f16b37b1d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicies.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BackupPolicies. */ +public interface BackupPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List backup policies for Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backup Policies. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + BackupPolicy get(String resourceGroupName, String accountName, String backupPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String backupPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String backupPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String backupPolicyName, Context context); + + /** + * Get a particular backup Policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + BackupPolicy getById(String id); + + /** + * Get a particular backup Policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup Policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete backup policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete backup policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BackupPolicy resource. + * + * @param name resource name. + * @return the first stage of the new BackupPolicy definition. + */ + BackupPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPoliciesList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPoliciesList.java new file mode 100644 index 000000000000..08f6b6535546 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPoliciesList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Backup Policies. */ +@Fluent +public final class BackupPoliciesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPoliciesList.class); + + /* + * A list of backup policies + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: A list of backup policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of backup policies. + * + * @param value the value value to set. + * @return the BackupPoliciesList object itself. + */ + public BackupPoliciesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicy.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicy.java new file mode 100644 index 000000000000..237cf1778100 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicy.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BackupPolicy. */ +public interface BackupPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the dailyBackupsToKeep property: Daily backups count to keep. + * + * @return the dailyBackupsToKeep value. + */ + Integer dailyBackupsToKeep(); + + /** + * Gets the weeklyBackupsToKeep property: Weekly backups count to keep. + * + * @return the weeklyBackupsToKeep value. + */ + Integer weeklyBackupsToKeep(); + + /** + * Gets the monthlyBackupsToKeep property: Monthly backups count to keep. + * + * @return the monthlyBackupsToKeep value. + */ + Integer monthlyBackupsToKeep(); + + /** + * Gets the yearlyBackupsToKeep property: Yearly backups count to keep. + * + * @return the yearlyBackupsToKeep value. + */ + Integer yearlyBackupsToKeep(); + + /** + * Gets the volumesAssigned property: Volumes using current backup policy. + * + * @return the volumesAssigned value. + */ + Integer volumesAssigned(); + + /** + * Gets the enabled property: The property to decide policy is enabled or not. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the volumeBackups property: A list of volumes assigned to this policy. + * + * @return the volumeBackups value. + */ + List volumeBackups(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner object. + * + * @return the inner object. + */ + BackupPolicyInner innerModel(); + + /** The entirety of the BackupPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The BackupPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the BackupPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BackupPolicy definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the BackupPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @return the next definition stage. + */ + WithCreate withExistingNetAppAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the BackupPolicy definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithDailyBackupsToKeep, + DefinitionStages.WithWeeklyBackupsToKeep, + DefinitionStages.WithMonthlyBackupsToKeep, + DefinitionStages.WithYearlyBackupsToKeep, + DefinitionStages.WithVolumesAssigned, + DefinitionStages.WithEnabled, + DefinitionStages.WithVolumeBackups { + /** + * Executes the create request. + * + * @return the created resource. + */ + BackupPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BackupPolicy create(Context context); + } + /** The stage of the BackupPolicy definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the BackupPolicy definition allowing to specify dailyBackupsToKeep. */ + interface WithDailyBackupsToKeep { + /** + * Specifies the dailyBackupsToKeep property: Daily backups count to keep. + * + * @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 weeklyBackupsToKeep. */ + interface WithWeeklyBackupsToKeep { + /** + * Specifies the weeklyBackupsToKeep property: Weekly backups count to keep. + * + * @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 monthlyBackupsToKeep. */ + interface WithMonthlyBackupsToKeep { + /** + * Specifies the monthlyBackupsToKeep property: Monthly backups count to keep. + * + * @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 yearlyBackupsToKeep. */ + interface WithYearlyBackupsToKeep { + /** + * Specifies the yearlyBackupsToKeep property: Yearly backups count to keep. + * + * @param yearlyBackupsToKeep Yearly backups count to keep. + * @return the next definition stage. + */ + WithCreate withYearlyBackupsToKeep(Integer yearlyBackupsToKeep); + } + /** The stage of the BackupPolicy definition allowing to specify volumesAssigned. */ + interface WithVolumesAssigned { + /** + * Specifies the volumesAssigned property: Volumes using current backup policy. + * + * @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 enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: The property to decide policy is enabled or not. + * + * @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 volumeBackups. */ + interface WithVolumeBackups { + /** + * Specifies the volumeBackups property: A list of volumes assigned to this policy. + * + * @param volumeBackups A list of volumes assigned to this policy. + * @return the next definition stage. + */ + WithCreate withVolumeBackups(List volumeBackups); + } + } + /** + * Begins update for the BackupPolicy resource. + * + * @return the stage of resource update. + */ + BackupPolicy.Update update(); + + /** The template for BackupPolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDailyBackupsToKeep, + UpdateStages.WithWeeklyBackupsToKeep, + UpdateStages.WithMonthlyBackupsToKeep, + UpdateStages.WithYearlyBackupsToKeep, + UpdateStages.WithVolumesAssigned, + UpdateStages.WithEnabled, + UpdateStages.WithVolumeBackups { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BackupPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BackupPolicy apply(Context context); + } + /** The BackupPolicy update stages. */ + interface UpdateStages { + /** The stage of the BackupPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the BackupPolicy update allowing to specify dailyBackupsToKeep. */ + interface WithDailyBackupsToKeep { + /** + * Specifies the dailyBackupsToKeep property: Daily backups count to keep. + * + * @param dailyBackupsToKeep Daily backups count to keep. + * @return the next definition stage. + */ + Update withDailyBackupsToKeep(Integer dailyBackupsToKeep); + } + /** The stage of the BackupPolicy update allowing to specify weeklyBackupsToKeep. */ + interface WithWeeklyBackupsToKeep { + /** + * Specifies the weeklyBackupsToKeep property: Weekly backups count to keep. + * + * @param weeklyBackupsToKeep Weekly backups count to keep. + * @return the next definition stage. + */ + Update withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep); + } + /** The stage of the BackupPolicy update allowing to specify monthlyBackupsToKeep. */ + interface WithMonthlyBackupsToKeep { + /** + * Specifies the monthlyBackupsToKeep property: Monthly backups count to keep. + * + * @param monthlyBackupsToKeep Monthly backups count to keep. + * @return the next definition stage. + */ + Update withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep); + } + /** The stage of the BackupPolicy update allowing to specify yearlyBackupsToKeep. */ + interface WithYearlyBackupsToKeep { + /** + * Specifies the yearlyBackupsToKeep property: Yearly backups count to keep. + * + * @param yearlyBackupsToKeep Yearly backups count to keep. + * @return the next definition stage. + */ + Update withYearlyBackupsToKeep(Integer yearlyBackupsToKeep); + } + /** The stage of the BackupPolicy update allowing to specify volumesAssigned. */ + interface WithVolumesAssigned { + /** + * Specifies the volumesAssigned property: Volumes using current backup policy. + * + * @param volumesAssigned Volumes using current backup policy. + * @return the next definition stage. + */ + Update withVolumesAssigned(Integer volumesAssigned); + } + /** The stage of the BackupPolicy update allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: The property to decide policy is enabled or not. + * + * @param enabled The property to decide policy is enabled or not. + * @return the next definition stage. + */ + Update withEnabled(Boolean enabled); + } + /** The stage of the BackupPolicy update allowing to specify volumeBackups. */ + interface WithVolumeBackups { + /** + * Specifies the volumeBackups property: A list of volumes assigned to this policy. + * + * @param volumeBackups A list of volumes assigned to this policy. + * @return the next definition stage. + */ + Update withVolumeBackups(List volumeBackups); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BackupPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BackupPolicy refresh(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicyPatch.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicyPatch.java new file mode 100644 index 000000000000..d0261fe5bbd3 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupPolicyPatch.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Backup policy Details for create and update. */ +@JsonFlatten +@Fluent +public class BackupPolicyPatch extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPolicyPatch.class); + + /* + * 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 the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the dailyBackupsToKeep property: Daily backups count to keep. + * + * @return the dailyBackupsToKeep value. + */ + public Integer dailyBackupsToKeep() { + return this.dailyBackupsToKeep; + } + + /** + * Set the dailyBackupsToKeep property: 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 the weeklyBackupsToKeep property: Weekly backups count to keep. + * + * @return the weeklyBackupsToKeep value. + */ + public Integer weeklyBackupsToKeep() { + return this.weeklyBackupsToKeep; + } + + /** + * Set the weeklyBackupsToKeep property: 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 the monthlyBackupsToKeep property: Monthly backups count to keep. + * + * @return the monthlyBackupsToKeep value. + */ + public Integer monthlyBackupsToKeep() { + return this.monthlyBackupsToKeep; + } + + /** + * Set the monthlyBackupsToKeep property: 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 the yearlyBackupsToKeep property: Yearly backups count to keep. + * + * @return the yearlyBackupsToKeep value. + */ + public Integer yearlyBackupsToKeep() { + return this.yearlyBackupsToKeep; + } + + /** + * Set the yearlyBackupsToKeep property: 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 the volumesAssigned property: Volumes using current backup policy. + * + * @return the volumesAssigned value. + */ + public Integer volumesAssigned() { + return this.volumesAssigned; + } + + /** + * Set the volumesAssigned property: 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 enabled property: The property to decide policy is enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: 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 the volumeBackups property: A list of volumes assigned to this policy. + * + * @return the volumeBackups value. + */ + public List volumeBackups() { + return this.volumeBackups; + } + + /** + * Set the volumeBackups property: 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; + } + + /** {@inheritDoc} */ + @Override + public BackupPolicyPatch withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackupPolicyPatch withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeBackups() != null) { + volumeBackups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backups.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backups.java new file mode 100644 index 000000000000..13464a8e42d8 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Backups.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Backups. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + PagedIterable list(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Backups. + */ + PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + Backup get(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String poolName, String volumeName, String backupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String backupName, + Context context); + + /** + * Get a particular backup of the volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + Backup getById(String id); + + /** + * Get a particular backup of the volume. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a particular backup of the volume. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a backup of the volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a backup of the volume. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Backup resource. + * + * @param name resource name. + * @return the first stage of the new Backup definition. + */ + Backup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupsList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupsList.java new file mode 100644 index 000000000000..ede826ff2169 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BackupsList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.resourcemanager.netapp.fluent.models.BackupsListInner; +import java.util.List; + +/** An immutable client-side representation of BackupsList. */ +public interface BackupsList { + /** + * Gets the value property: A list of Backups. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.BackupsListInner object. + * + * @return the inner object. + */ + BackupsListInner innerModel(); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BreakReplicationRequest.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BreakReplicationRequest.java new file mode 100644 index 000000000000..b334b31a8c54 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/BreakReplicationRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Break replication request. */ +@Fluent +public final class BreakReplicationRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BreakReplicationRequest.class); + + /* + * If replication is in status transferring and you want to force break the + * replication, set to true + */ + @JsonProperty(value = "forceBreakReplication") + private Boolean forceBreakReplication; + + /** + * Get the forceBreakReplication property: 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 the forceBreakReplication property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPool.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPool.java new file mode 100644 index 000000000000..70d4a1de8409 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPool.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.CapacityPoolInner; +import java.util.Map; + +/** An immutable client-side representation of CapacityPool. */ +public interface CapacityPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the poolId property: UUID v4 used to identify the Pool. + * + * @return the poolId value. + */ + String poolId(); + + /** + * Gets the size property: Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be + * multiply of 4398046511104). + * + * @return the size value. + */ + long size(); + + /** + * Gets the serviceLevel property: The service level of the file system. + * + * @return the serviceLevel value. + */ + ServiceLevel serviceLevel(); + + /** + * Gets the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the totalThroughputMibps property: Total throughput of pool in Mibps. + * + * @return the totalThroughputMibps value. + */ + Float totalThroughputMibps(); + + /** + * Gets the utilizedThroughputMibps property: Utilized throughput of pool in Mibps. + * + * @return the utilizedThroughputMibps value. + */ + Float utilizedThroughputMibps(); + + /** + * Gets the qosType property: The qos type of the pool. + * + * @return the qosType value. + */ + QosType qosType(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.CapacityPoolInner object. + * + * @return the inner object. + */ + CapacityPoolInner innerModel(); + + /** The entirety of the CapacityPool definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithSize, + DefinitionStages.WithServiceLevel, + DefinitionStages.WithCreate { + } + /** The CapacityPool definition stages. */ + interface DefinitionStages { + /** The first stage of the CapacityPool definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CapacityPool definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the CapacityPool definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @return the next definition stage. + */ + WithSize withExistingNetAppAccount(String resourceGroupName, String accountName); + } + /** The stage of the CapacityPool definition allowing to specify size. */ + interface WithSize { + /** + * Specifies the size property: Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks + * (value must be multiply of 4398046511104).. + * + * @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. + */ + WithServiceLevel withSize(long size); + } + /** The stage of the CapacityPool definition allowing to specify serviceLevel. */ + interface WithServiceLevel { + /** + * Specifies the serviceLevel property: The service level of the file system. + * + * @param serviceLevel The service level of the file system. + * @return the next definition stage. + */ + WithCreate withServiceLevel(ServiceLevel serviceLevel); + } + /** + * The stage of the CapacityPool definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithQosType { + /** + * Executes the create request. + * + * @return the created resource. + */ + CapacityPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CapacityPool create(Context context); + } + /** The stage of the CapacityPool definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the CapacityPool definition allowing to specify qosType. */ + interface WithQosType { + /** + * Specifies the qosType property: The qos type of the pool. + * + * @param qosType The qos type of the pool. + * @return the next definition stage. + */ + WithCreate withQosType(QosType qosType); + } + } + /** + * Begins update for the CapacityPool resource. + * + * @return the stage of resource update. + */ + CapacityPool.Update update(); + + /** The template for CapacityPool update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSize, UpdateStages.WithQosType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CapacityPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CapacityPool apply(Context context); + } + /** The CapacityPool update stages. */ + interface UpdateStages { + /** The stage of the CapacityPool update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the CapacityPool update allowing to specify size. */ + interface WithSize { + /** + * Specifies the size property: Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks + * (value must be multiply of 4398046511104).. + * + * @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. + */ + Update withSize(Long size); + } + /** The stage of the CapacityPool update allowing to specify qosType. */ + interface WithQosType { + /** + * Specifies the qosType property: The qos type of the pool. + * + * @param qosType The qos type of the pool. + * @return the next definition stage. + */ + Update withQosType(QosType qosType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CapacityPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CapacityPool refresh(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolList.java new file mode 100644 index 000000000000..57f1b9266ae1 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.CapacityPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of capacity pool resources. */ +@Fluent +public final class CapacityPoolList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityPoolList.class); + + /* + * List of Capacity pools + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Capacity pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Capacity pools. + * + * @param value the value value to set. + * @return the CapacityPoolList object itself. + */ + public CapacityPoolList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the CapacityPoolList object itself. + */ + public CapacityPoolList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolPatch.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolPatch.java new file mode 100644 index 000000000000..649539baba1a --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CapacityPoolPatch.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Capacity pool patch resource. */ +@JsonFlatten +@Fluent +public class CapacityPoolPatch extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapacityPoolPatch.class); + + /* + * 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; + + /* + * The qos type of the pool + */ + @JsonProperty(value = "properties.qosType") + private QosType qosType; + + /** + * Get the size property: 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 the size property: 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 qosType property: The qos type of the pool. + * + * @return the qosType value. + */ + public QosType qosType() { + return this.qosType; + } + + /** + * Set the qosType property: The qos type of the pool. + * + * @param qosType the qosType value to set. + * @return the CapacityPoolPatch object itself. + */ + public CapacityPoolPatch withQosType(QosType qosType) { + this.qosType = qosType; + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityPoolPatch withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CapacityPoolPatch withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckAvailabilityResponse.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckAvailabilityResponse.java new file mode 100644 index 000000000000..f62330360993 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckAvailabilityResponse.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.resourcemanager.netapp.fluent.models.CheckAvailabilityResponseInner; + +/** An immutable client-side representation of CheckAvailabilityResponse. */ +public interface CheckAvailabilityResponse { + /** + * Gets the isAvailable property: <code>true</code> indicates name is valid and available. + * <code>false</code> indicates the name is invalid, unavailable, or both. + * + * @return the isAvailable value. + */ + Boolean isAvailable(); + + /** + * Gets the reason property: <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. + * + * @return the reason value. + */ + InAvailabilityReasonType reason(); + + /** + * Gets the message property: 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. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.CheckAvailabilityResponseInner object. + * + * @return the inner object. + */ + CheckAvailabilityResponseInner innerModel(); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckNameResourceTypes.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckNameResourceTypes.java new file mode 100644 index 000000000000..72b16ab4fcf0 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckNameResourceTypes.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CheckNameResourceTypes. */ +public final class CheckNameResourceTypes extends ExpandableStringEnum { + /** Static value Microsoft.NetApp/netAppAccounts for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APP_NET_APP_ACCOUNTS = + fromString("Microsoft.NetApp/netAppAccounts"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS = + fromString("Microsoft.NetApp/netAppAccounts/capacityPools"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = + fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = + 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckQuotaNameResourceTypes.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckQuotaNameResourceTypes.java new file mode 100644 index 000000000000..111e960fc7f8 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CheckQuotaNameResourceTypes.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CheckQuotaNameResourceTypes. */ +public final class CheckQuotaNameResourceTypes extends ExpandableStringEnum { + /** Static value Microsoft.NetApp/netAppAccounts for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes MICROSOFT_NET_APP_NET_APP_ACCOUNTS = + fromString("Microsoft.NetApp/netAppAccounts"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS = + fromString("Microsoft.NetApp/netAppAccounts/capacityPools"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES = + fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots for CheckQuotaNameResourceTypes. */ + public static final CheckQuotaNameResourceTypes + MICROSOFT_NET_APP_NET_APP_ACCOUNTS_CAPACITY_POOLS_VOLUMES_SNAPSHOTS = + 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CreatedByType.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CreatedByType.java new file mode 100644 index 000000000000..4e14022cab98 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/CreatedByType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CreatedByType. */ +public final class CreatedByType extends ExpandableStringEnum { + /** Static value User for CreatedByType. */ + public static final CreatedByType USER = fromString("User"); + + /** Static value Application for CreatedByType. */ + public static final CreatedByType APPLICATION = fromString("Application"); + + /** Static value ManagedIdentity for CreatedByType. */ + public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** Static value Key for CreatedByType. */ + public static final CreatedByType KEY = fromString("Key"); + + /** + * Creates or finds a CreatedByType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreatedByType. + */ + @JsonCreator + public static CreatedByType fromString(String name) { + return fromString(name, CreatedByType.class); + } + + /** @return known CreatedByType values. */ + public static Collection values() { + return values(CreatedByType.class); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/DailySchedule.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/DailySchedule.java new file mode 100644 index 000000000000..bf9bf7a5364b --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/DailySchedule.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Daily Schedule properties. */ +@Fluent +public final class DailySchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DailySchedule.class); + + /* + * 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 the snapshotsToKeep property: Daily snapshot count to keep. + * + * @return the snapshotsToKeep value. + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set the snapshotsToKeep property: 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 the hour property: Indicates which hour in UTC timezone a snapshot should be taken. + * + * @return the hour value. + */ + public Integer hour() { + return this.hour; + } + + /** + * Set the hour property: 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 the minute property: Indicates which minute snapshot should be taken. + * + * @return the minute value. + */ + public Integer minute() { + return this.minute; + } + + /** + * Set the minute property: 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 the usedBytes property: Resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value. + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set the usedBytes property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Dimension.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Dimension.java new file mode 100644 index 000000000000..1a3e90bfc950 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Dimension.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dimension of blobs, possibly be blob type or access tier. */ +@Fluent +public final class Dimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); + + /* + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: Display name of dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the displayName property: Display name of dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/EndpointType.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/EndpointType.java new file mode 100644 index 000000000000..7b200d3714ec --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/EndpointType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ExportPolicyRule.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ExportPolicyRule.java new file mode 100644 index 000000000000..00dd0d355b3f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ExportPolicyRule.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume Export Policy Rule. */ +@Fluent +public final class ExportPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportPolicyRule.class); + + /* + * 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 the ruleIndex property: Order index. + * + * @return the ruleIndex value. + */ + public Integer ruleIndex() { + return this.ruleIndex; + } + + /** + * Set the ruleIndex property: 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 the unixReadOnly property: Read only access. + * + * @return the unixReadOnly value. + */ + public Boolean unixReadOnly() { + return this.unixReadOnly; + } + + /** + * Set the unixReadOnly property: 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 the unixReadWrite property: Read and write access. + * + * @return the unixReadWrite value. + */ + public Boolean unixReadWrite() { + return this.unixReadWrite; + } + + /** + * Set the unixReadWrite property: 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 the kerberos5ReadOnly property: 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 the kerberos5ReadOnly property: 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 the kerberos5ReadWrite property: 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 the kerberos5ReadWrite property: 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 the kerberos5IReadOnly property: 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 the kerberos5IReadOnly property: 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 the kerberos5IReadWrite property: 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 the kerberos5IReadWrite property: 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 the kerberos5PReadOnly property: 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 the kerberos5PReadOnly property: 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 the kerberos5PReadWrite property: 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 the kerberos5PReadWrite property: 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 the cifs property: Allows CIFS protocol. + * + * @return the cifs value. + */ + public Boolean cifs() { + return this.cifs; + } + + /** + * Set the cifs property: 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 the nfsv3 property: Allows NFSv3 protocol. Enable only for NFSv3 type volumes. + * + * @return the nfsv3 value. + */ + public Boolean nfsv3() { + return this.nfsv3; + } + + /** + * Set the nfsv3 property: 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 the nfsv41 property: Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes. + * + * @return the nfsv41 value. + */ + public Boolean nfsv41() { + return this.nfsv41; + } + + /** + * Set the nfsv41 property: 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 the allowedClients property: 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 the allowedClients property: 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 the hasRootAccess property: Has root access to volume. + * + * @return the hasRootAccess value. + */ + public Boolean hasRootAccess() { + return this.hasRootAccess; + } + + /** + * Set the hasRootAccess property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/HourlySchedule.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/HourlySchedule.java new file mode 100644 index 000000000000..55c9fdafa75e --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/HourlySchedule.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hourly Schedule properties. */ +@Fluent +public final class HourlySchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HourlySchedule.class); + + /* + * 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 the snapshotsToKeep property: Hourly snapshot count to keep. + * + * @return the snapshotsToKeep value. + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set the snapshotsToKeep property: 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 the minute property: Indicates which minute snapshot should be taken. + * + * @return the minute value. + */ + public Integer minute() { + return this.minute; + } + + /** + * Set the minute property: 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 the usedBytes property: Resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value. + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set the usedBytes property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/InAvailabilityReasonType.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/InAvailabilityReasonType.java new file mode 100644 index 000000000000..2dbf273087ce --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/InAvailabilityReasonType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/KeySource.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/KeySource.java new file mode 100644 index 000000000000..07bd9cf92ef5 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/KeySource.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KeySource. */ +public final class KeySource extends ExpandableStringEnum { + /** Static value Microsoft.NetApp for KeySource. */ + public static final KeySource MICROSOFT_NET_APP = fromString("Microsoft.NetApp"); + + /** + * Creates or finds a KeySource from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeySource. + */ + @JsonCreator + public static KeySource fromString(String name) { + return fromString(name, KeySource.class); + } + + /** @return known KeySource values. */ + public static Collection values() { + return values(KeySource.class); + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MetricSpecification.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MetricSpecification.java new file mode 100644 index 000000000000..1077da5c090f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MetricSpecification.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification of operation. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * 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 the name property: Name of metric specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the displayName property: Display name of metric specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: 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 the displayDescription property: Display description of metric specification. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: 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 the unit property: Unit could be Bytes or Count. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: 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 the dimensions property: Dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: 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 the aggregationType property: Aggregation type could be Average. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: 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 fillGapWithZero property: The property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: 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 property: The category this metric specification belong to, could be Capacity. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: 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 the resourceIdDimensionNameOverride property: Account Resource Id. + * + * @return the resourceIdDimensionNameOverride value. + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resourceIdDimensionNameOverride property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MirrorState.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MirrorState.java new file mode 100644 index 000000000000..3023db197620 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MirrorState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MonthlySchedule.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MonthlySchedule.java new file mode 100644 index 000000000000..e52042b5622d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MonthlySchedule.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Monthly Schedule properties. */ +@Fluent +public final class MonthlySchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MonthlySchedule.class); + + /* + * 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 the snapshotsToKeep property: Monthly snapshot count to keep. + * + * @return the snapshotsToKeep value. + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set the snapshotsToKeep property: 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 the daysOfMonth property: 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 the daysOfMonth property: 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 the hour property: Indicates which hour in UTC timezone a snapshot should be taken. + * + * @return the hour value. + */ + public Integer hour() { + return this.hour; + } + + /** + * Set the hour property: 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 the minute property: Indicates which minute snapshot should be taken. + * + * @return the minute value. + */ + public Integer minute() { + return this.minute; + } + + /** + * Set the minute property: 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 the usedBytes property: Resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value. + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set the usedBytes property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MountTargetProperties.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MountTargetProperties.java new file mode 100644 index 000000000000..3b99ec11f430 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/MountTargetProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Mount target properties. */ +@Fluent +public final class MountTargetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MountTargetProperties.class); + + /* + * UUID v4 used to identify the MountTarget + */ + @JsonProperty(value = "mountTargetId", access = JsonProperty.Access.WRITE_ONLY) + private String mountTargetId; + + /* + * UUID v4 used to identify the MountTarget + */ + @JsonProperty(value = "fileSystemId", required = true) + private String fileSystemId; + + /* + * The mount target's IPv4 address + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * The SMB server's Fully Qualified Domain Name, FQDN + */ + @JsonProperty(value = "smbServerFqdn") + private String smbServerFqdn; + + /** + * Get the mountTargetId property: UUID v4 used to identify the MountTarget. + * + * @return the mountTargetId value. + */ + public String mountTargetId() { + return this.mountTargetId; + } + + /** + * Get the fileSystemId property: UUID v4 used to identify the MountTarget. + * + * @return the fileSystemId value. + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set the fileSystemId property: 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 ipAddress property: The mount target's IPv4 address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the smbServerFqdn property: The SMB server's Fully Qualified Domain Name, FQDN. + * + * @return the smbServerFqdn value. + */ + public String smbServerFqdn() { + return this.smbServerFqdn; + } + + /** + * Set the smbServerFqdn property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fileSystemId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fileSystemId in model MountTargetProperties")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccount.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccount.java new file mode 100644 index 000000000000..daf1499e382a --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccount.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetAppAccount. */ +public interface NetAppAccount { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the activeDirectories property: Active Directories. + * + * @return the activeDirectories value. + */ + List activeDirectories(); + + /** + * Gets the encryption property: Encryption settings. + * + * @return the encryption value. + */ + AccountEncryption encryption(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner object. + * + * @return the inner object. + */ + NetAppAccountInner innerModel(); + + /** The entirety of the NetAppAccount definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetAppAccount definition stages. */ + interface DefinitionStages { + /** The first stage of the NetAppAccount definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetAppAccount definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NetAppAccount definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetAppAccount definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithActiveDirectories, DefinitionStages.WithEncryption { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetAppAccount create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetAppAccount create(Context context); + } + /** The stage of the NetAppAccount definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NetAppAccount definition allowing to specify activeDirectories. */ + interface WithActiveDirectories { + /** + * Specifies the activeDirectories property: Active Directories. + * + * @param activeDirectories Active Directories. + * @return the next definition stage. + */ + WithCreate withActiveDirectories(List activeDirectories); + } + /** The stage of the NetAppAccount definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption settings. + * + * @param encryption Encryption settings. + * @return the next definition stage. + */ + WithCreate withEncryption(AccountEncryption encryption); + } + } + /** + * Begins update for the NetAppAccount resource. + * + * @return the stage of resource update. + */ + NetAppAccount.Update update(); + + /** The template for NetAppAccount update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithActiveDirectories, UpdateStages.WithEncryption { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetAppAccount apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetAppAccount apply(Context context); + } + /** The NetAppAccount update stages. */ + interface UpdateStages { + /** The stage of the NetAppAccount update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the NetAppAccount update allowing to specify activeDirectories. */ + interface WithActiveDirectories { + /** + * Specifies the activeDirectories property: Active Directories. + * + * @param activeDirectories Active Directories. + * @return the next definition stage. + */ + Update withActiveDirectories(List activeDirectories); + } + /** The stage of the NetAppAccount update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption settings. + * + * @param encryption Encryption settings. + * @return the next definition stage. + */ + Update withEncryption(AccountEncryption encryption); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetAppAccount refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetAppAccount refresh(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountList.java new file mode 100644 index 000000000000..18d16c5d6a9d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of NetApp account resources. */ +@Fluent +public final class NetAppAccountList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetAppAccountList.class); + + /* + * Multiple NetApp accounts + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Multiple NetApp accounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Multiple NetApp accounts. + * + * @param value the value value to set. + * @return the NetAppAccountList object itself. + */ + public NetAppAccountList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetAppAccountList object itself. + */ + public NetAppAccountList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountPatch.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountPatch.java new file mode 100644 index 000000000000..2896e007f870 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppAccountPatch.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetApp account patch resource. */ +@JsonFlatten +@Fluent +public class NetAppAccountPatch extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetAppAccountPatch.class); + + /* + * Azure lifecycle management + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Active Directories + */ + @JsonProperty(value = "properties.activeDirectories") + private List activeDirectories; + + /* + * Encryption settings + */ + @JsonProperty(value = "properties.encryption") + private AccountEncryption encryption; + + /** + * Get the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the activeDirectories property: Active Directories. + * + * @return the activeDirectories value. + */ + public List activeDirectories() { + return this.activeDirectories; + } + + /** + * Set the activeDirectories property: Active Directories. + * + * @param activeDirectories the activeDirectories value to set. + * @return the NetAppAccountPatch object itself. + */ + public NetAppAccountPatch withActiveDirectories(List activeDirectories) { + this.activeDirectories = activeDirectories; + return this; + } + + /** + * Get the encryption property: Encryption settings. + * + * @return the encryption value. + */ + public AccountEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption settings. + * + * @param encryption the encryption value to set. + * @return the NetAppAccountPatch object itself. + */ + public NetAppAccountPatch withEncryption(AccountEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetAppAccountPatch withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetAppAccountPatch withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (activeDirectories() != null) { + activeDirectories().forEach(e -> e.validate()); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppResources.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppResources.java new file mode 100644 index 000000000000..1fe7b3e3aa8f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/NetAppResources.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetAppResources. */ +public interface NetAppResources { + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + CheckAvailabilityResponse checkNameAvailability(String location, ResourceNameAvailabilityRequest body); + + /** + * Check if a resource name is available. + * + * @param location The location. + * @param body Name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + Response checkNameAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context); + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + CheckAvailabilityResponse checkFilePathAvailability(String location, ResourceNameAvailabilityRequest body); + + /** + * Check if a file path is available. + * + * @param location The location. + * @param body File path availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + Response checkFilePathAvailabilityWithResponse( + String location, ResourceNameAvailabilityRequest body, Context context); + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + CheckAvailabilityResponse checkQuotaAvailability(String location, QuotaAvailabilityRequest body); + + /** + * Check if a quota is available. + * + * @param location The location. + * @param body Quota availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information regarding availability of a resource. + */ + Response checkQuotaAvailabilityWithResponse( + String location, QuotaAvailabilityRequest body, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operation.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operation.java new file mode 100644 index 000000000000..da8407caf63f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.resourcemanager.netapp.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The origin of operations. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationDisplay.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationDisplay.java new file mode 100644 index 000000000000..c6a4eb56751c --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * 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 the provider property: Service provider: Microsoft NetApp. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: 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 the resource property: Resource on which the operation is performed etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: 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 the operation property: Type of operation: get, read, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: 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 the description property: Operation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Operation description. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationListResult.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationListResult.java new file mode 100644 index 000000000000..33ed0ad62cec --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/OperationListResult.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Cloud Volume operations. It contains a list of operations and a URL link to get the + * next set of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of Storage operations supported by the Storage resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of Storage operations supported by the Storage resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Storage operations supported by the Storage resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operations.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operations.java new file mode 100644 index 000000000000..04a2f56920a5 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + PagedIterable list(); + + /** + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Cloud Volume operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/PoolChangeRequest.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/PoolChangeRequest.java new file mode 100644 index 000000000000..7f4ff5aab0a0 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/PoolChangeRequest.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Pool change request. */ +@Fluent +public final class PoolChangeRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PoolChangeRequest.class); + + /* + * Resource id of the pool to move volume to + */ + @JsonProperty(value = "newPoolResourceId", required = true) + private String newPoolResourceId; + + /** + * Get the newPoolResourceId property: Resource id of the pool to move volume to. + * + * @return the newPoolResourceId value. + */ + public String newPoolResourceId() { + return this.newPoolResourceId; + } + + /** + * Set the newPoolResourceId property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (newPoolResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property newPoolResourceId in model PoolChangeRequest")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Pools.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Pools.java new file mode 100644 index 000000000000..98f3d0146647 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Pools.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Pools. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of capacity pool resources. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + CapacityPool get(String resourceGroupName, String accountName, String poolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String poolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String poolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String poolName, Context context); + + /** + * Get details of the specified capacity pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + CapacityPool getById(String id); + + /** + * Get details of the specified capacity pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified capacity pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the specified capacity pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the specified capacity pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CapacityPool resource. + * + * @param name resource name. + * @return the first stage of the new CapacityPool definition. + */ + CapacityPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QosType.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QosType.java new file mode 100644 index 000000000000..8fb9d8d0ccaf --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QosType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QuotaAvailabilityRequest.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QuotaAvailabilityRequest.java new file mode 100644 index 000000000000..331c0db04734 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/QuotaAvailabilityRequest.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Quota availability request content. */ +@Fluent +public final class QuotaAvailabilityRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaAvailabilityRequest.class); + + /* + * Name of the resource to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Resource type used for verification. + */ + @JsonProperty(value = "type", required = true) + private CheckQuotaNameResourceTypes type; + + /* + * Resource group name. + */ + @JsonProperty(value = "resourceGroup", required = true) + private String resourceGroup; + + /** + * Get the name property: Name of the resource to verify. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the type property: Resource type used for verification. + * + * @return the type value. + */ + public CheckQuotaNameResourceTypes type() { + return this.type; + } + + /** + * Set the type property: Resource type used for verification. + * + * @param type the type value to set. + * @return the QuotaAvailabilityRequest object itself. + */ + public QuotaAvailabilityRequest withType(CheckQuotaNameResourceTypes type) { + this.type = type; + return this; + } + + /** + * Get the resourceGroup property: Resource group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model QuotaAvailabilityRequest")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model QuotaAvailabilityRequest")); + } + if (resourceGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceGroup in model QuotaAvailabilityRequest")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/RelationshipStatus.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/RelationshipStatus.java new file mode 100644 index 000000000000..ca782d0c427b --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/RelationshipStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationObject.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationObject.java new file mode 100644 index 000000000000..35b10b339af3 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationObject.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replication properties. */ +@Fluent +public final class ReplicationObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationObject.class); + + /* + * Id + */ + @JsonProperty(value = "replicationId") + private String replicationId; + + /* + * Indicates whether the local volume is the source or destination for the + * Volume Replication + */ + @JsonProperty(value = "endpointType") + private EndpointType endpointType; + + /* + * Schedule + */ + @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 the replicationId property: Id. + * + * @return the replicationId value. + */ + public String replicationId() { + return this.replicationId; + } + + /** + * Set the replicationId property: Id. + * + * @param replicationId the replicationId value to set. + * @return the ReplicationObject object itself. + */ + public ReplicationObject withReplicationId(String replicationId) { + this.replicationId = replicationId; + return this; + } + + /** + * Get the endpointType property: Indicates whether the local volume is the source or destination for the Volume + * Replication. + * + * @return the endpointType value. + */ + public EndpointType endpointType() { + return this.endpointType; + } + + /** + * Set the endpointType property: Indicates whether the local volume is the source or destination for the Volume + * Replication. + * + * @param endpointType the endpointType value to set. + * @return the ReplicationObject object itself. + */ + public ReplicationObject withEndpointType(EndpointType endpointType) { + this.endpointType = endpointType; + return this; + } + + /** + * Get the replicationSchedule property: Schedule. + * + * @return the replicationSchedule value. + */ + public ReplicationSchedule replicationSchedule() { + return this.replicationSchedule; + } + + /** + * Set the replicationSchedule property: Schedule. + * + * @param replicationSchedule the replicationSchedule value to set. + * @return the ReplicationObject object itself. + */ + public ReplicationObject withReplicationSchedule(ReplicationSchedule replicationSchedule) { + this.replicationSchedule = replicationSchedule; + return this; + } + + /** + * Get the remoteVolumeResourceId property: The resource ID of the remote volume. + * + * @return the remoteVolumeResourceId value. + */ + public String remoteVolumeResourceId() { + return this.remoteVolumeResourceId; + } + + /** + * Set the remoteVolumeResourceId property: 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 remoteVolumeRegion property: The remote region for the other end of the Volume Replication. + * + * @return the remoteVolumeRegion value. + */ + public String remoteVolumeRegion() { + return this.remoteVolumeRegion; + } + + /** + * Set the remoteVolumeRegion property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (replicationSchedule() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property replicationSchedule in model ReplicationObject")); + } + if (remoteVolumeResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteVolumeResourceId in model ReplicationObject")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationSchedule.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationSchedule.java new file mode 100644 index 000000000000..ae4b75185d4d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationSchedule.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReplicationSchedule. */ +public final class ReplicationSchedule extends ExpandableStringEnum { + /** Static value _10minutely for ReplicationSchedule. */ + public static final ReplicationSchedule ONE_ZEROMINUTELY = 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationStatus.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationStatus.java new file mode 100644 index 000000000000..619473e0f56c --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ReplicationStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.resourcemanager.netapp.fluent.models.ReplicationStatusInner; + +/** An immutable client-side representation of ReplicationStatus. */ +public interface ReplicationStatus { + /** + * Gets the healthy property: Replication health check. + * + * @return the healthy value. + */ + Boolean healthy(); + + /** + * Gets the relationshipStatus property: Status of the mirror relationship. + * + * @return the relationshipStatus value. + */ + RelationshipStatus relationshipStatus(); + + /** + * Gets the mirrorState property: The status of the replication. + * + * @return the mirrorState value. + */ + MirrorState mirrorState(); + + /** + * Gets the totalProgress property: The progress of the replication. + * + * @return the totalProgress value. + */ + String totalProgress(); + + /** + * Gets the errorMessage property: Displays error message if the replication is in an error state. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.ReplicationStatusInner object. + * + * @return the inner object. + */ + ReplicationStatusInner innerModel(); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ResourceNameAvailabilityRequest.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ResourceNameAvailabilityRequest.java new file mode 100644 index 000000000000..24ec34ac130f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ResourceNameAvailabilityRequest.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource name availability request content. */ +@Fluent +public final class ResourceNameAvailabilityRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNameAvailabilityRequest.class); + + /* + * Resource name to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Resource type used for verification. + */ + @JsonProperty(value = "type", required = true) + private CheckNameResourceTypes type; + + /* + * Resource group name. + */ + @JsonProperty(value = "resourceGroup", required = true) + private String resourceGroup; + + /** + * Get the name property: Resource name to verify. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the type property: Resource type used for verification. + * + * @return the type value. + */ + public CheckNameResourceTypes type() { + return this.type; + } + + /** + * Set the type property: Resource type used for verification. + * + * @param type the type value to set. + * @return the ResourceNameAvailabilityRequest object itself. + */ + public ResourceNameAvailabilityRequest withType(CheckNameResourceTypes type) { + this.type = type; + return this; + } + + /** + * Get the resourceGroup property: Resource group name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ResourceNameAvailabilityRequest")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model ResourceNameAvailabilityRequest")); + } + if (resourceGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceGroup in model ResourceNameAvailabilityRequest")); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SecurityStyle.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SecurityStyle.java new file mode 100644 index 000000000000..3aa59c8153c5 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SecurityStyle.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceLevel.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceLevel.java new file mode 100644 index 000000000000..096f1c02eafb --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceLevel.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceSpecification.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceSpecification.java new file mode 100644 index 000000000000..912e494da4bd --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/ServiceSpecification.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** One property of operation, include metric specifications. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the metricSpecifications property: Metric specifications of operation. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshot.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshot.java new file mode 100644 index 000000000000..4c1b6f05e316 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshot.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Snapshot. */ +public interface Snapshot { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the snapshotId property: UUID v4 used to identify the Snapshot. + * + * @return the snapshotId value. + */ + String snapshotId(); + + /** + * Gets the created property: The creation date of the snapshot. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.SnapshotInner object. + * + * @return the inner object. + */ + SnapshotInner innerModel(); + + /** The entirety of the Snapshot definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Snapshot definition stages. */ + interface DefinitionStages { + /** The first stage of the Snapshot definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Snapshot definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Snapshot definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingVolume( + String resourceGroupName, String accountName, String poolName, String volumeName); + } + /** + * The stage of the Snapshot definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + Snapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Snapshot create(Context context); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Snapshot refresh(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicies.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicies.java new file mode 100644 index 000000000000..a2115338ff39 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicies.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SnapshotPolicies. */ +public interface SnapshotPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List snapshot policy. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshot Policies. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + SnapshotPolicy get(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String snapshotPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + SnapshotPolicyVolumeList listVolumes(String resourceGroupName, String accountName, String snapshotPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return volumes associated with snapshot policy. + */ + Response listVolumesWithResponse( + String resourceGroupName, String accountName, String snapshotPolicyName, Context context); + + /** + * Get a snapshot Policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + SnapshotPolicy getById(String id); + + /** + * Get a snapshot Policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a snapshot Policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete snapshot policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete snapshot policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SnapshotPolicy resource. + * + * @param name resource name. + * @return the first stage of the new SnapshotPolicy definition. + */ + SnapshotPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPoliciesList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPoliciesList.java new file mode 100644 index 000000000000..9760eae3f76f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPoliciesList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Snapshot Policies. */ +@Fluent +public final class SnapshotPoliciesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotPoliciesList.class); + + /* + * A list of snapshot policies + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: A list of snapshot policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of snapshot policies. + * + * @param value the value value to set. + * @return the SnapshotPoliciesList object itself. + */ + public SnapshotPoliciesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicy.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicy.java new file mode 100644 index 000000000000..a2b252004125 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicy.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyInner; +import java.util.Map; + +/** An immutable client-side representation of SnapshotPolicy. */ +public interface SnapshotPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the hourlySchedule property: Schedule for hourly snapshots. + * + * @return the hourlySchedule value. + */ + HourlySchedule hourlySchedule(); + + /** + * Gets the dailySchedule property: Schedule for daily snapshots. + * + * @return the dailySchedule value. + */ + DailySchedule dailySchedule(); + + /** + * Gets the weeklySchedule property: Schedule for weekly snapshots. + * + * @return the weeklySchedule value. + */ + WeeklySchedule weeklySchedule(); + + /** + * Gets the monthlySchedule property: Schedule for monthly snapshots. + * + * @return the monthlySchedule value. + */ + MonthlySchedule monthlySchedule(); + + /** + * Gets the enabled property: The property to decide policy is enabled or not. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyInner object. + * + * @return the inner object. + */ + SnapshotPolicyInner innerModel(); + + /** The entirety of the SnapshotPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The SnapshotPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the SnapshotPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SnapshotPolicy definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the SnapshotPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @return the next definition stage. + */ + WithCreate withExistingNetAppAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the SnapshotPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithHourlySchedule, + DefinitionStages.WithDailySchedule, + DefinitionStages.WithWeeklySchedule, + DefinitionStages.WithMonthlySchedule, + DefinitionStages.WithEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + SnapshotPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SnapshotPolicy create(Context context); + } + /** The stage of the SnapshotPolicy definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SnapshotPolicy definition allowing to specify hourlySchedule. */ + interface WithHourlySchedule { + /** + * Specifies the hourlySchedule property: Schedule for hourly snapshots. + * + * @param hourlySchedule Schedule for hourly snapshots. + * @return the next definition stage. + */ + WithCreate withHourlySchedule(HourlySchedule hourlySchedule); + } + /** The stage of the SnapshotPolicy definition allowing to specify dailySchedule. */ + interface WithDailySchedule { + /** + * Specifies the dailySchedule property: Schedule for daily snapshots. + * + * @param dailySchedule Schedule for daily snapshots. + * @return the next definition stage. + */ + WithCreate withDailySchedule(DailySchedule dailySchedule); + } + /** The stage of the SnapshotPolicy definition allowing to specify weeklySchedule. */ + interface WithWeeklySchedule { + /** + * Specifies the weeklySchedule property: Schedule for weekly snapshots. + * + * @param weeklySchedule Schedule for weekly snapshots. + * @return the next definition stage. + */ + WithCreate withWeeklySchedule(WeeklySchedule weeklySchedule); + } + /** The stage of the SnapshotPolicy definition allowing to specify monthlySchedule. */ + interface WithMonthlySchedule { + /** + * Specifies the monthlySchedule property: Schedule for monthly snapshots. + * + * @param monthlySchedule Schedule for monthly snapshots. + * @return the next definition stage. + */ + WithCreate withMonthlySchedule(MonthlySchedule monthlySchedule); + } + /** The stage of the SnapshotPolicy definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: The property to decide policy is enabled or not. + * + * @param enabled The property to decide policy is enabled or not. + * @return the next definition stage. + */ + WithCreate withEnabled(Boolean enabled); + } + } + /** + * Begins update for the SnapshotPolicy resource. + * + * @return the stage of resource update. + */ + SnapshotPolicy.Update update(); + + /** The template for SnapshotPolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithHourlySchedule, + UpdateStages.WithDailySchedule, + UpdateStages.WithWeeklySchedule, + UpdateStages.WithMonthlySchedule, + UpdateStages.WithEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SnapshotPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SnapshotPolicy apply(Context context); + } + /** The SnapshotPolicy update stages. */ + interface UpdateStages { + /** The stage of the SnapshotPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SnapshotPolicy update allowing to specify hourlySchedule. */ + interface WithHourlySchedule { + /** + * Specifies the hourlySchedule property: Schedule for hourly snapshots. + * + * @param hourlySchedule Schedule for hourly snapshots. + * @return the next definition stage. + */ + Update withHourlySchedule(HourlySchedule hourlySchedule); + } + /** The stage of the SnapshotPolicy update allowing to specify dailySchedule. */ + interface WithDailySchedule { + /** + * Specifies the dailySchedule property: Schedule for daily snapshots. + * + * @param dailySchedule Schedule for daily snapshots. + * @return the next definition stage. + */ + Update withDailySchedule(DailySchedule dailySchedule); + } + /** The stage of the SnapshotPolicy update allowing to specify weeklySchedule. */ + interface WithWeeklySchedule { + /** + * Specifies the weeklySchedule property: Schedule for weekly snapshots. + * + * @param weeklySchedule Schedule for weekly snapshots. + * @return the next definition stage. + */ + Update withWeeklySchedule(WeeklySchedule weeklySchedule); + } + /** The stage of the SnapshotPolicy update allowing to specify monthlySchedule. */ + interface WithMonthlySchedule { + /** + * Specifies the monthlySchedule property: Schedule for monthly snapshots. + * + * @param monthlySchedule Schedule for monthly snapshots. + * @return the next definition stage. + */ + Update withMonthlySchedule(MonthlySchedule monthlySchedule); + } + /** The stage of the SnapshotPolicy update allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: The property to decide policy is enabled or not. + * + * @param enabled The property to decide policy is enabled or not. + * @return the next definition stage. + */ + Update withEnabled(Boolean enabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SnapshotPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SnapshotPolicy refresh(Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyPatch.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyPatch.java new file mode 100644 index 000000000000..5e7e990aa49f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyPatch.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Snapshot policy Details for create and update. */ +@JsonFlatten +@Fluent +public class SnapshotPolicyPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotPolicyPatch.class); + + /* + * 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 namePropertiesName; + + /* + * Schedule for hourly snapshots + */ + @JsonProperty(value = "properties.hourlySchedule") + private HourlySchedule hourlySchedule; + + /* + * Schedule for daily snapshots + */ + @JsonProperty(value = "properties.dailySchedule") + private DailySchedule dailySchedule; + + /* + * Schedule for weekly snapshots + */ + @JsonProperty(value = "properties.weeklySchedule") + private WeeklySchedule weeklySchedule; + + /* + * 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 the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: 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 the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 the namePropertiesName property: Snapshot policy name. + * + * @return the namePropertiesName value. + */ + public String namePropertiesName() { + return this.namePropertiesName; + } + + /** + * Get the hourlySchedule property: Schedule for hourly snapshots. + * + * @return the hourlySchedule value. + */ + public HourlySchedule hourlySchedule() { + return this.hourlySchedule; + } + + /** + * Set the hourlySchedule property: 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 the dailySchedule property: Schedule for daily snapshots. + * + * @return the dailySchedule value. + */ + public DailySchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set the dailySchedule property: 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 the weeklySchedule property: Schedule for weekly snapshots. + * + * @return the weeklySchedule value. + */ + public WeeklySchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set the weeklySchedule property: 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 the monthlySchedule property: Schedule for monthly snapshots. + * + * @return the monthlySchedule value. + */ + public MonthlySchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set the monthlySchedule property: 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 enabled property: The property to decide policy is enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: 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 the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hourlySchedule() != null) { + hourlySchedule().validate(); + } + if (dailySchedule() != null) { + dailySchedule().validate(); + } + if (weeklySchedule() != null) { + weeklySchedule().validate(); + } + if (monthlySchedule() != null) { + monthlySchedule().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyVolumeList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyVolumeList.java new file mode 100644 index 000000000000..c658fcbc9830 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotPolicyVolumeList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyVolumeListInner; +import java.util.List; + +/** An immutable client-side representation of SnapshotPolicyVolumeList. */ +public interface SnapshotPolicyVolumeList { + /** + * Gets the value property: List of volumes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyVolumeListInner object. + * + * @return the inner object. + */ + SnapshotPolicyVolumeListInner innerModel(); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshots.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshots.java new file mode 100644 index 000000000000..207fa0af8ac5 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Snapshots.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Snapshots. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + PagedIterable list(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots. + */ + PagedIterable list( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + Snapshot get(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + Response getWithResponse( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + Snapshot update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return snapshot of a Volume. + */ + Snapshot update( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Object body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + String snapshotName, + Context context); + + /** + * Get details of the specified snapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + Snapshot getById(String id); + + /** + * Get details of the specified snapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified snapshot. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete snapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete snapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Snapshot resource. + * + * @param name resource name. + * @return the first stage of the new Snapshot definition. + */ + Snapshot.DefinitionStages.Blank define(String name); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotsList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotsList.java new file mode 100644 index 000000000000..054800ade20c --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SnapshotsList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.SnapshotInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Snapshots. */ +@Fluent +public final class SnapshotsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotsList.class); + + /* + * A list of Snapshots + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: A list of Snapshots. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Snapshots. + * + * @param value the value value to set. + * @return the SnapshotsList object itself. + */ + public SnapshotsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SystemData.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SystemData.java new file mode 100644 index 000000000000..98eb7107344b --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/SystemData.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Metadata pertaining to creation and last modification of the resource. */ +@Fluent +public final class SystemData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemData.class); + + /* + * The identity that created the resource. + */ + @JsonProperty(value = "createdBy") + private String createdBy; + + /* + * The type of identity that created the resource. + */ + @JsonProperty(value = "createdByType") + private CreatedByType createdByType; + + /* + * The timestamp of resource creation (UTC). + */ + @JsonProperty(value = "createdAt") + private OffsetDateTime createdAt; + + /* + * The identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedBy") + private String lastModifiedBy; + + /* + * The type of identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedByType") + private CreatedByType lastModifiedByType; + + /* + * The type of identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedAt") + private OffsetDateTime lastModifiedAt; + + /** + * Get the createdBy property: The identity that created the resource. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: The identity that created the resource. + * + * @param createdBy the createdBy value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the createdByType property: The type of identity that created the resource. + * + * @return the createdByType value. + */ + public CreatedByType createdByType() { + return this.createdByType; + } + + /** + * Set the createdByType property: The type of identity that created the resource. + * + * @param createdByType the createdByType value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedByType(CreatedByType createdByType) { + this.createdByType = createdByType; + return this; + } + + /** + * Get the createdAt property: The timestamp of resource creation (UTC). + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: The timestamp of resource creation (UTC). + * + * @param createdAt the createdAt value to set. + * @return the SystemData object itself. + */ + public SystemData withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the lastModifiedBy property: The identity that last modified the resource. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the lastModifiedBy property: The identity that last modified the resource. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the lastModifiedByType property: The type of identity that last modified the resource. + * + * @return the lastModifiedByType value. + */ + public CreatedByType lastModifiedByType() { + return this.lastModifiedByType; + } + + /** + * Set the lastModifiedByType property: The type of identity that last modified the resource. + * + * @param lastModifiedByType the lastModifiedByType value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedByType(CreatedByType lastModifiedByType) { + this.lastModifiedByType = lastModifiedByType; + return this; + } + + /** + * Get the lastModifiedAt property: The type of identity that last modified the resource. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Set the lastModifiedAt property: The type of identity that last modified the resource. + * + * @param lastModifiedAt the lastModifiedAt value to set. + * @return the SystemData object itself. + */ + public SystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vault.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vault.java new file mode 100644 index 000000000000..d27d1206b4a8 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vault.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.resourcemanager.netapp.fluent.models.VaultInner; + +/** An immutable client-side representation of Vault. */ +public interface Vault { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the vaultName property: Vault Name. + * + * @return the vaultName value. + */ + String vaultName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.VaultInner object. + * + * @return the inner object. + */ + VaultInner innerModel(); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VaultList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VaultList.java new file mode 100644 index 000000000000..5392f171c952 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VaultList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.VaultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Vaults. */ +@Fluent +public final class VaultList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultList.class); + + /* + * A list of vaults + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: A list of vaults. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of vaults. + * + * @param value the value value to set. + * @return the VaultList object itself. + */ + public VaultList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vaults.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vaults.java new file mode 100644 index 000000000000..8a30f1772ae4 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Vaults.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Vaults. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List vaults for a Netapp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Vaults. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volume.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volume.java new file mode 100644 index 000000000000..dc9eea800e0d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volume.java @@ -0,0 +1,782 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.netapp.fluent.models.VolumeInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Volume. */ +public interface Volume { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the fileSystemId property: Unique FileSystem Identifier. + * + * @return the fileSystemId value. + */ + String fileSystemId(); + + /** + * Gets the creationToken property: A unique file path for the volume. Used when creating mount targets. + * + * @return the creationToken value. + */ + String creationToken(); + + /** + * Gets the serviceLevel property: The service level of the file system. + * + * @return the serviceLevel value. + */ + ServiceLevel serviceLevel(); + + /** + * Gets the usageThreshold property: 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. + */ + long usageThreshold(); + + /** + * Gets the exportPolicy property: Set of export policy rules. + * + * @return the exportPolicy value. + */ + VolumePropertiesExportPolicy exportPolicy(); + + /** + * Gets the protocolTypes property: Set of protocol types, default NFSv3, CIFS fro SMB protocol. + * + * @return the protocolTypes value. + */ + List protocolTypes(); + + /** + * Gets the provisioningState property: Azure lifecycle management. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the snapshotId property: UUID v4 or resource identifier used to identify the Snapshot. + * + * @return the snapshotId value. + */ + String snapshotId(); + + /** + * Gets the backupId property: UUID v4 or resource identifier used to identify the Backup. + * + * @return the backupId value. + */ + String backupId(); + + /** + * Gets the baremetalTenantId property: Unique Baremetal Tenant Identifier. + * + * @return the baremetalTenantId value. + */ + String baremetalTenantId(); + + /** + * Gets the subnetId property: The Azure Resource URI for a delegated subnet. Must have the delegation + * Microsoft.NetApp/volumes. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the mountTargets property: List of mount targets. + * + * @return the mountTargets value. + */ + List mountTargets(); + + /** + * Gets the volumeType property: What type of volume is this. + * + * @return the volumeType value. + */ + String volumeType(); + + /** + * Gets the dataProtection property: DataProtection type volumes include an object containing details of the + * replication. + * + * @return the dataProtection value. + */ + VolumePropertiesDataProtection dataProtection(); + + /** + * Gets the isRestoring property: Restoring. + * + * @return the isRestoring value. + */ + Boolean isRestoring(); + + /** + * Gets the snapshotDirectoryVisible property: 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. + */ + Boolean snapshotDirectoryVisible(); + + /** + * Gets the kerberosEnabled property: Describe if a volume is KerberosEnabled. To be use with swagger version + * 2020-05-01 or later. + * + * @return the kerberosEnabled value. + */ + Boolean kerberosEnabled(); + + /** + * Gets the securityStyle property: The security style of volume, default unix, defaults to ntfs for dual protocol + * or CIFS protocol. + * + * @return the securityStyle value. + */ + SecurityStyle securityStyle(); + + /** + * Gets the smbEncryption property: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol + * volume. To be used with swagger version 2020-08-01 or later. + * + * @return the smbEncryption value. + */ + Boolean smbEncryption(); + + /** + * Gets the smbContinuouslyAvailable property: Enables continuously available share property for smb volume. Only + * applicable for SMB volume. + * + * @return the smbContinuouslyAvailable value. + */ + Boolean smbContinuouslyAvailable(); + + /** + * Gets the throughputMibps property: Maximum throughput in Mibps that can be achieved by this volume. + * + * @return the throughputMibps value. + */ + Float throughputMibps(); + + /** + * Gets the encryptionKeySource property: Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + * + * @return the encryptionKeySource value. + */ + String encryptionKeySource(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.netapp.fluent.models.VolumeInner object. + * + * @return the inner object. + */ + VolumeInner innerModel(); + + /** The entirety of the Volume definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreationToken, + DefinitionStages.WithUsageThreshold, + DefinitionStages.WithSubnetId, + DefinitionStages.WithCreate { + } + /** The Volume definition stages. */ + interface DefinitionStages { + /** The first stage of the Volume definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Volume definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Volume definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 the creationToken property: A unique file path for the volume. Used when creating mount + * targets. + * + * @param creationToken A unique file path for the volume. Used when creating mount targets. + * @return the next definition stage. + */ + WithUsageThreshold withCreationToken(String creationToken); + } + /** The stage of the Volume definition allowing to specify usageThreshold. */ + interface WithUsageThreshold { + /** + * Specifies the usageThreshold property: 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 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. + */ + WithSubnetId withUsageThreshold(long usageThreshold); + } + /** The stage of the Volume definition allowing to specify subnetId. */ + interface WithSubnetId { + /** + * Specifies the subnetId property: The Azure Resource URI for a delegated subnet. Must have the delegation + * Microsoft.NetApp/volumes. + * + * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation + * Microsoft.NetApp/volumes. + * @return the next definition stage. + */ + WithCreate withSubnetId(String subnetId); + } + /** + * The stage of the Volume definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithServiceLevel, + DefinitionStages.WithExportPolicy, + DefinitionStages.WithProtocolTypes, + DefinitionStages.WithSnapshotId, + DefinitionStages.WithBackupId, + DefinitionStages.WithVolumeType, + DefinitionStages.WithDataProtection, + DefinitionStages.WithIsRestoring, + DefinitionStages.WithSnapshotDirectoryVisible, + DefinitionStages.WithKerberosEnabled, + DefinitionStages.WithSecurityStyle, + DefinitionStages.WithSmbEncryption, + DefinitionStages.WithSmbContinuouslyAvailable, + DefinitionStages.WithThroughputMibps, + DefinitionStages.WithEncryptionKeySource { + /** + * Executes the create request. + * + * @return the created resource. + */ + Volume create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Volume create(Context context); + } + /** The stage of the Volume definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Volume definition allowing to specify serviceLevel. */ + interface WithServiceLevel { + /** + * Specifies the serviceLevel property: The service level of the file system. + * + * @param serviceLevel The service level of the file system. + * @return the next definition stage. + */ + WithCreate withServiceLevel(ServiceLevel serviceLevel); + } + /** The stage of the Volume definition allowing to specify exportPolicy. */ + interface WithExportPolicy { + /** + * Specifies the exportPolicy property: Set of export policy rules. + * + * @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 protocolTypes. */ + interface WithProtocolTypes { + /** + * Specifies the protocolTypes property: Set of protocol types, default NFSv3, CIFS fro SMB protocol. + * + * @param protocolTypes Set of protocol types, default NFSv3, CIFS fro SMB protocol. + * @return the next definition stage. + */ + WithCreate withProtocolTypes(List protocolTypes); + } + /** The stage of the Volume definition allowing to specify snapshotId. */ + interface WithSnapshotId { + /** + * Specifies the snapshotId property: UUID v4 or resource identifier used to identify the Snapshot.. + * + * @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 backupId. */ + interface WithBackupId { + /** + * Specifies the backupId property: UUID v4 or resource identifier used to identify the Backup.. + * + * @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 volumeType. */ + interface WithVolumeType { + /** + * Specifies the volumeType property: What type of volume is this. + * + * @param volumeType What type of volume is this. + * @return the next definition stage. + */ + WithCreate withVolumeType(String volumeType); + } + /** The stage of the Volume definition allowing to specify dataProtection. */ + interface WithDataProtection { + /** + * Specifies the dataProtection property: DataProtection type volumes include an object containing details + * of the replication. + * + * @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 isRestoring. */ + interface WithIsRestoring { + /** + * Specifies the isRestoring property: Restoring. + * + * @param isRestoring Restoring. + * @return the next definition stage. + */ + WithCreate withIsRestoring(Boolean isRestoring); + } + /** The stage of the Volume definition allowing to specify snapshotDirectoryVisible. */ + interface WithSnapshotDirectoryVisible { + /** + * Specifies the snapshotDirectoryVisible property: 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 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 kerberosEnabled. */ + interface WithKerberosEnabled { + /** + * Specifies the kerberosEnabled property: Describe if a volume is KerberosEnabled. To be use with swagger + * version 2020-05-01 or later. + * + * @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 securityStyle. */ + interface WithSecurityStyle { + /** + * Specifies the securityStyle property: The security style of volume, default unix, defaults to ntfs for + * dual protocol or CIFS protocol. + * + * @param securityStyle The security style of volume, default unix, defaults to ntfs for dual protocol or + * CIFS protocol. + * @return the next definition stage. + */ + WithCreate withSecurityStyle(SecurityStyle securityStyle); + } + /** The stage of the Volume definition allowing to specify smbEncryption. */ + interface WithSmbEncryption { + /** + * Specifies the smbEncryption property: Enables encryption for in-flight smb3 data. Only applicable for + * SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. + * + * @param smbEncryption Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol + * volume. To be used with swagger version 2020-08-01 or later. + * @return the next definition stage. + */ + WithCreate withSmbEncryption(Boolean smbEncryption); + } + /** The stage of the Volume definition allowing to specify smbContinuouslyAvailable. */ + interface WithSmbContinuouslyAvailable { + /** + * Specifies the smbContinuouslyAvailable property: Enables continuously available share property for smb + * volume. Only applicable for SMB volume. + * + * @param smbContinuouslyAvailable Enables continuously available share property for smb volume. Only + * applicable for SMB volume. + * @return the next definition stage. + */ + WithCreate withSmbContinuouslyAvailable(Boolean smbContinuouslyAvailable); + } + /** The stage of the Volume definition allowing to specify throughputMibps. */ + interface WithThroughputMibps { + /** + * Specifies the throughputMibps property: Maximum throughput in Mibps that can be achieved by this volume. + * + * @param throughputMibps Maximum throughput in Mibps that can be achieved by this volume. + * @return the next definition stage. + */ + WithCreate withThroughputMibps(Float throughputMibps); + } + /** The stage of the Volume definition allowing to specify encryptionKeySource. */ + interface WithEncryptionKeySource { + /** + * Specifies the encryptionKeySource property: Encryption Key Source. Possible values are: + * 'Microsoft.NetApp'. + * + * @param encryptionKeySource Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + * @return the next definition stage. + */ + WithCreate withEncryptionKeySource(String encryptionKeySource); + } + } + /** + * Begins update for the Volume resource. + * + * @return the stage of resource update. + */ + Volume.Update update(); + + /** The template for Volume update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithServiceLevel, + UpdateStages.WithUsageThreshold, + UpdateStages.WithExportPolicy, + UpdateStages.WithThroughputMibps, + UpdateStages.WithDataProtection { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Volume apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Volume apply(Context context); + } + /** The Volume update stages. */ + interface UpdateStages { + /** The stage of the Volume update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Volume update allowing to specify serviceLevel. */ + interface WithServiceLevel { + /** + * Specifies the serviceLevel property: The service level of the file system. + * + * @param serviceLevel The service level of the file system. + * @return the next definition stage. + */ + Update withServiceLevel(ServiceLevel serviceLevel); + } + /** The stage of the Volume update allowing to specify usageThreshold. */ + interface WithUsageThreshold { + /** + * Specifies the usageThreshold property: 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 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. + */ + Update withUsageThreshold(Long usageThreshold); + } + /** The stage of the Volume update allowing to specify exportPolicy. */ + interface WithExportPolicy { + /** + * Specifies the exportPolicy property: Set of export policy rules. + * + * @param exportPolicy Set of export policy rules. + * @return the next definition stage. + */ + Update withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy); + } + /** The stage of the Volume update allowing to specify throughputMibps. */ + interface WithThroughputMibps { + /** + * Specifies the throughputMibps property: Maximum throughput in Mibps that can be achieved by this volume. + * + * @param throughputMibps Maximum throughput in Mibps that can be achieved by this volume. + * @return the next definition stage. + */ + Update withThroughputMibps(Float throughputMibps); + } + /** The stage of the Volume update allowing to specify dataProtection. */ + interface WithDataProtection { + /** + * Specifies the dataProtection property: DataProtection type volumes include an object containing details + * of the replication. + * + * @param dataProtection DataProtection type volumes include an object containing details of the + * replication. + * @return the next definition stage. + */ + Update withDataProtection(VolumePatchPropertiesDataProtection dataProtection); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Volume refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Volume refresh(Context context); + + /** + * Revert a volume to the snapshot specified in the body. + * + * @param body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert(VolumeRevert body); + + /** + * Revert a volume to the snapshot specified in the body. + * + * @param body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert(VolumeRevert body, Context context); + + /** + * Break the replication connection on the destination volume. + * + * @param body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakReplication(BreakReplicationRequest body); + + /** + * Break the replication connection on the destination volume. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakReplication(); + + /** + * Break the replication connection on the destination volume. + * + * @param body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakReplication(BreakReplicationRequest body, Context context); + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resyncReplication(); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resyncReplication(Context context); + + /** + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteReplication(); + + /** + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteReplication(Context context); + + /** + * Authorize the replication connection on the source volume. + * + * @param body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void authorizeReplication(AuthorizeRequest body); + + /** + * Authorize the replication connection on the source volume. + * + * @param body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void authorizeReplication(AuthorizeRequest body, Context context); + + /** + * Re-Initializes the replication connection on the destination volume. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reInitializeReplication(); + + /** + * Re-Initializes the replication connection on the destination volume. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reInitializeReplication(Context context); + + /** + * Moves volume to another pool. + * + * @param body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void poolChange(PoolChangeRequest body); + + /** + * Moves volume to another pool. + * + * @param body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void poolChange(PoolChangeRequest body, Context context); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackupProperties.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackupProperties.java new file mode 100644 index 000000000000..ed59afbc95c6 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackupProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume Backup Properties. */ +@Fluent +public final class VolumeBackupProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumeBackupProperties.class); + + /* + * 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 the backupPolicyId property: Backup Policy Resource ID. + * + * @return the backupPolicyId value. + */ + public String backupPolicyId() { + return this.backupPolicyId; + } + + /** + * Set the backupPolicyId property: 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 the policyEnforced property: Policy Enforced. + * + * @return the policyEnforced value. + */ + public Boolean policyEnforced() { + return this.policyEnforced; + } + + /** + * Set the policyEnforced property: 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 the vaultId property: Vault Resource ID. + * + * @return the vaultId value. + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Set the vaultId property: 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 the backupEnabled property: Backup Enabled. + * + * @return the backupEnabled value. + */ + public Boolean backupEnabled() { + return this.backupEnabled; + } + + /** + * Set the backupEnabled property: Backup Enabled. + * + * @param backupEnabled the backupEnabled value to set. + * @return the VolumeBackupProperties object itself. + */ + public VolumeBackupProperties withBackupEnabled(Boolean backupEnabled) { + this.backupEnabled = backupEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackups.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackups.java new file mode 100644 index 000000000000..83d6d152f7e0 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeBackups.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume details using the backup policy. */ +@Fluent +public final class VolumeBackups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumeBackups.class); + + /* + * 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 the volumeName property: Volume name. + * + * @return the volumeName value. + */ + public String volumeName() { + return this.volumeName; + } + + /** + * Set the volumeName property: 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 the backupsCount property: Total count of backups for volume. + * + * @return the backupsCount value. + */ + public Integer backupsCount() { + return this.backupsCount; + } + + /** + * Set the backupsCount property: 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 the policyEnabled property: Policy enabled. + * + * @return the policyEnabled value. + */ + public Boolean policyEnabled() { + return this.policyEnabled; + } + + /** + * Set the policyEnabled property: Policy enabled. + * + * @param policyEnabled the policyEnabled value to set. + * @return the VolumeBackups object itself. + */ + public VolumeBackups withPolicyEnabled(Boolean policyEnabled) { + this.policyEnabled = policyEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeList.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeList.java new file mode 100644 index 000000000000..46a96f5821eb --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.netapp.fluent.models.VolumeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of volume resources. */ +@Fluent +public final class VolumeList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumeList.class); + + /* + * List of volumes + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of volumes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of volumes. + * + * @param value the value value to set. + * @return the VolumeList object itself. + */ + public VolumeList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VolumeList object itself. + */ + public VolumeList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatch.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatch.java new file mode 100644 index 000000000000..5ffd7ece7ad5 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatch.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Volume patch resource. */ +@JsonFlatten +@Fluent +public class VolumePatch extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumePatch.class); + + /* + * The service level of the file system + */ + @JsonProperty(value = "properties.serviceLevel") + private ServiceLevel serviceLevel; + + /* + * 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; + + /* + * Set of export policy rules + */ + @JsonProperty(value = "properties.exportPolicy") + private VolumePatchPropertiesExportPolicy exportPolicy; + + /* + * Maximum throughput in Mibps that can be achieved by this volume + */ + @JsonProperty(value = "properties.throughputMibps") + private Float throughputMibps; + + /* + * DataProtection type volumes include an object containing details of the + * replication + */ + @JsonProperty(value = "properties.dataProtection") + private VolumePatchPropertiesDataProtection dataProtection; + + /** + * Get the serviceLevel property: The service level of the file system. + * + * @return the serviceLevel value. + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the serviceLevel property: The service level of the file system. + * + * @param serviceLevel the serviceLevel value to set. + * @return the VolumePatch object itself. + */ + public VolumePatch withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get the usageThreshold property: 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 the usageThreshold property: 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 the exportPolicy property: Set of export policy rules. + * + * @return the exportPolicy value. + */ + public VolumePatchPropertiesExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set the exportPolicy property: 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 property: Maximum throughput in Mibps that can be achieved by this volume. + * + * @return the throughputMibps value. + */ + public Float throughputMibps() { + return this.throughputMibps; + } + + /** + * Set the throughputMibps property: Maximum throughput in Mibps that can be achieved by this volume. + * + * @param throughputMibps the throughputMibps value to set. + * @return the VolumePatch object itself. + */ + public VolumePatch withThroughputMibps(Float throughputMibps) { + this.throughputMibps = throughputMibps; + return this; + } + + /** + * Get the dataProtection property: DataProtection type volumes include an object containing details of the + * replication. + * + * @return the dataProtection value. + */ + public VolumePatchPropertiesDataProtection dataProtection() { + return this.dataProtection; + } + + /** + * Set the dataProtection property: 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; + } + + /** {@inheritDoc} */ + @Override + public VolumePatch withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VolumePatch withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exportPolicy() != null) { + exportPolicy().validate(); + } + if (dataProtection() != null) { + dataProtection().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesDataProtection.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesDataProtection.java new file mode 100644 index 000000000000..45ec38466bf7 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesDataProtection.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** DataProtection type volumes include an object containing details of the replication. */ +@Fluent +public final class VolumePatchPropertiesDataProtection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumePatchPropertiesDataProtection.class); + + /* + * Backup Properties + */ + @JsonProperty(value = "backup") + private VolumeBackupProperties backup; + + /** + * Get the backup property: Backup Properties. + * + * @return the backup value. + */ + public VolumeBackupProperties backup() { + return this.backup; + } + + /** + * Set the backup property: Backup Properties. + * + * @param backup the backup value to set. + * @return the VolumePatchPropertiesDataProtection object itself. + */ + public VolumePatchPropertiesDataProtection withBackup(VolumeBackupProperties backup) { + this.backup = backup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backup() != null) { + backup().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesExportPolicy.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesExportPolicy.java new file mode 100644 index 000000000000..7d580059cced --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePatchPropertiesExportPolicy.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Set of export policy rules. */ +@Fluent +public final class VolumePatchPropertiesExportPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumePatchPropertiesExportPolicy.class); + + /* + * Export policy rule + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the rules property: Export policy rule. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesDataProtection.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesDataProtection.java new file mode 100644 index 000000000000..4f175bbab9f3 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesDataProtection.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** DataProtection type volumes include an object containing details of the replication. */ +@Fluent +public final class VolumePropertiesDataProtection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumePropertiesDataProtection.class); + + /* + * Backup Properties + */ + @JsonProperty(value = "backup") + private VolumeBackupProperties backup; + + /* + * Replication properties + */ + @JsonProperty(value = "replication") + private ReplicationObject replication; + + /* + * Snapshot properties. + */ + @JsonProperty(value = "snapshot") + private VolumeSnapshotProperties snapshot; + + /** + * Get the backup property: Backup Properties. + * + * @return the backup value. + */ + public VolumeBackupProperties backup() { + return this.backup; + } + + /** + * Set the backup property: 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 the replication property: Replication properties. + * + * @return the replication value. + */ + public ReplicationObject replication() { + return this.replication; + } + + /** + * Set the replication property: 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 the snapshot property: Snapshot properties. + * + * @return the snapshot value. + */ + public VolumeSnapshotProperties snapshot() { + return this.snapshot; + } + + /** + * Set the snapshot property: Snapshot properties. + * + * @param snapshot the snapshot value to set. + * @return the VolumePropertiesDataProtection object itself. + */ + public VolumePropertiesDataProtection withSnapshot(VolumeSnapshotProperties snapshot) { + this.snapshot = snapshot; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backup() != null) { + backup().validate(); + } + if (replication() != null) { + replication().validate(); + } + if (snapshot() != null) { + snapshot().validate(); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesExportPolicy.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesExportPolicy.java new file mode 100644 index 000000000000..92a6432485cc --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumePropertiesExportPolicy.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Set of export policy rules. */ +@Fluent +public final class VolumePropertiesExportPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumePropertiesExportPolicy.class); + + /* + * Export policy rule + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the rules property: Export policy rule. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeRevert.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeRevert.java new file mode 100644 index 000000000000..ae33a731af3f --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeRevert.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** revert a volume to the snapshot. */ +@Fluent +public final class VolumeRevert { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumeRevert.class); + + /* + * Resource id of the snapshot + */ + @JsonProperty(value = "snapshotId") + private String snapshotId; + + /** + * Get the snapshotId property: Resource id of the snapshot. + * + * @return the snapshotId value. + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set the snapshotId property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeSnapshotProperties.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeSnapshotProperties.java new file mode 100644 index 000000000000..65cb1f1a8fec --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/VolumeSnapshotProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume Snapshot Properties. */ +@Fluent +public final class VolumeSnapshotProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumeSnapshotProperties.class); + + /* + * Snapshot Policy ResourceId + */ + @JsonProperty(value = "snapshotPolicyId") + private String snapshotPolicyId; + + /** + * Get the snapshotPolicyId property: Snapshot Policy ResourceId. + * + * @return the snapshotPolicyId value. + */ + public String snapshotPolicyId() { + return this.snapshotPolicyId; + } + + /** + * Set the snapshotPolicyId property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volumes.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volumes.java new file mode 100644 index 000000000000..3840f878a51d --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/Volumes.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Volumes. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + PagedIterable list(String resourceGroupName, String accountName, String poolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of volume resources. + */ + PagedIterable list(String resourceGroupName, String accountName, String poolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + Volume get(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeRevert body); + + /** + * 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 body Object for snapshot to revert supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revert( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + VolumeRevert body, + Context context); + + /** + * 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 body Optional body to force break the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, BreakReplicationRequest body); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 body Optional body to force break the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void breakReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + BreakReplicationRequest body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + ReplicationStatus replicationStatus( + String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the replication. + */ + Response replicationStatusWithResponse( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resyncReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void authorizeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, AuthorizeRequest body); + + /** + * 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 body Authorize request object supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void authorizeReplication( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + AuthorizeRequest body, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reInitializeReplication(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reInitializeReplication( + String resourceGroupName, String accountName, String poolName, String volumeName, Context context); + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void poolChange( + String resourceGroupName, String accountName, String poolName, String volumeName, PoolChangeRequest body); + + /** + * 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 body Move volume to the pool supplied in the body of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void poolChange( + String resourceGroupName, + String accountName, + String poolName, + String volumeName, + PoolChangeRequest body, + Context context); + + /** + * Get the details of the specified volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + Volume getById(String id); + + /** + * Get the details of the specified volume. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the specified volume. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the specified volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the specified volume. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Volume resource. + * + * @param name resource name. + * @return the first stage of the new Volume definition. + */ + Volume.DefinitionStages.Blank define(String name); +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/WeeklySchedule.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/WeeklySchedule.java new file mode 100644 index 000000000000..95a94f47299e --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/WeeklySchedule.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.netapp.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Weekly Schedule properties, make a snapshot every week at a specific day or days. */ +@Fluent +public final class WeeklySchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WeeklySchedule.class); + + /* + * 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 the snapshotsToKeep property: Weekly snapshot count to keep. + * + * @return the snapshotsToKeep value. + */ + public Integer snapshotsToKeep() { + return this.snapshotsToKeep; + } + + /** + * Set the snapshotsToKeep property: 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 the day property: 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 the day property: 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 the hour property: Indicates which hour in UTC timezone a snapshot should be taken. + * + * @return the hour value. + */ + public Integer hour() { + return this.hour; + } + + /** + * Set the hour property: 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 the minute property: Indicates which minute snapshot should be taken. + * + * @return the minute value. + */ + public Integer minute() { + return this.minute; + } + + /** + * Set the minute property: 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 the usedBytes property: Resource size in bytes, current storage usage for the volume in bytes. + * + * @return the usedBytes value. + */ + public Long usedBytes() { + return this.usedBytes; + } + + /** + * Set the usedBytes property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/package-info.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/package-info.java new file mode 100644 index 000000000000..0642f16d54d1 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for NetAppManagementClient. Microsoft NetApp Azure Resource Provider + * specification. + */ +package com.azure.resourcemanager.netapp.models; diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/package-info.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/package-info.java new file mode 100644 index 000000000000..074807304b77 --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for NetAppManagementClient. Microsoft NetApp Azure Resource Provider specification. + */ +package com.azure.resourcemanager.netapp; diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/main/java/module-info.java b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/module-info.java new file mode 100644 index 000000000000..ea44febf1e8c --- /dev/null +++ b/sdk/netapp/azure-resourcemanager-netapp/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.netapp { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.netapp; + exports com.azure.resourcemanager.netapp.fluent; + exports com.azure.resourcemanager.netapp.fluent.models; + exports com.azure.resourcemanager.netapp.models; + + opens com.azure.resourcemanager.netapp.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.netapp.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/netapp/ci.yml b/sdk/netapp/ci.yml new file mode 100644 index 000000000000..e42599f3c44b --- /dev/null +++ b/sdk/netapp/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: netapp + Artifacts: + - name: azure-resourcemanager-netapp + groupId: com.azure.resourcemanager + safeName: azureresourcemanagernetapp diff --git a/sdk/netapp/pom.xml b/sdk/netapp/pom.xml new file mode 100644 index 000000000000..571ed38c3529 --- /dev/null +++ b/sdk/netapp/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-netapp-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-netapp + + + +