From 86015b0431ac93c5709a4504b5a1c18dd322644b Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 6 Oct 2020 10:01:42 +0000 Subject: [PATCH] Generated from 6fead2a2941ab37306aa7ea72304702a1880dd34 --- sdk/netapp/mgmt-v2020_03_01/pom.xml | 135 + .../netapp/v2020_03_01/Accounts.java | 24 + .../netapp/v2020_03_01/ActiveDirectory.java | 282 ++ .../netapp/v2020_03_01/AuthorizeRequest.java | 43 + .../netapp/v2020_03_01/CapacityPool.java | 203 ++ .../netapp/v2020_03_01/CapacityPoolPatch.java | 76 + .../v2020_03_01/CheckNameResourceTypes.java | 47 + .../netapp/v2020_03_01/Dimension.java | 69 + .../netapp/v2020_03_01/EndpointType.java | 41 + .../netapp/v2020_03_01/ExportPolicyRule.java | 200 ++ .../v2020_03_01/InAvailabilityReasonType.java | 41 + .../v2020_03_01/MetricSpecification.java | 252 ++ .../netapp/v2020_03_01/MirrorState.java | 44 + .../netapp/v2020_03_01/MountTarget.java | 340 +++ .../v2020_03_01/MountTargetProperties.java | 240 ++ .../netapp/v2020_03_01/NetAppAccount.java | 103 + .../v2020_03_01/NetAppAccountPatch.java | 62 + .../netapp/v2020_03_01/NetAppResources.java | 45 + .../netapp/v2020_03_01/Operation.java | 40 + .../netapp/v2020_03_01/OperationDisplay.java | 121 + .../netapp/v2020_03_01/Operations.java | 28 + .../netapp/v2020_03_01/PatchServiceLevel.java | 44 + .../management/netapp/v2020_03_01/Pools.java | 56 + .../v2020_03_01/RelationshipStatus.java | 41 + .../netapp/v2020_03_01/ReplicationObject.java | 149 + .../v2020_03_01/ReplicationSchedule.java | 50 + .../netapp/v2020_03_01/ReplicationStatus.java | 45 + .../v2020_03_01/ResourceNameAvailability.java | 35 + .../ResourceNameAvailabilityRequest.java | 99 + .../netapp/v2020_03_01/ServiceLevel.java | 44 + .../v2020_03_01/ServiceSpecification.java | 44 + .../netapp/v2020_03_01/Snapshot.java | 135 + .../netapp/v2020_03_01/Snapshots.java | 62 + .../management/netapp/v2020_03_01/Volume.java | 392 +++ .../netapp/v2020_03_01/VolumePatch.java | 104 + .../VolumePatchPropertiesExportPolicy.java | 46 + .../VolumePropertiesDataProtection.java | 73 + .../VolumePropertiesExportPolicy.java | 46 + .../netapp/v2020_03_01/VolumeRevert.java | 43 + .../v2020_03_01/VolumeSnapshotProperties.java | 43 + .../netapp/v2020_03_01/Volumes.java | 137 + .../implementation/AccountsImpl.java | 114 + .../implementation/AccountsInner.java | 805 ++++++ .../AzureNetAppFilesManagementClientImpl.java | 266 ++ .../implementation/CapacityPoolImpl.java | 189 ++ .../implementation/CapacityPoolInner.java | 108 + .../implementation/IdParsingUtils.java | 57 + .../implementation/NetAppAccountImpl.java | 89 + .../implementation/NetAppAccountInner.java | 63 + .../implementation/NetAppManager.java | 159 ++ .../implementation/NetAppResourcesImpl.java | 55 + .../implementation/NetAppResourcesInner.java | 283 ++ .../implementation/OperationImpl.java | 48 + .../implementation/OperationInner.java | 125 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 138 + .../v2020_03_01/implementation/PageImpl.java | 75 + .../v2020_03_01/implementation/PoolsImpl.java | 85 + .../implementation/PoolsInner.java | 852 ++++++ .../implementation/ReplicationStatusImpl.java | 53 + .../ReplicationStatusInner.java | 151 ++ .../ResourceNameAvailabilityImpl.java | 42 + .../ResourceNameAvailabilityInner.java | 106 + .../implementation/SnapshotImpl.java | 135 + .../implementation/SnapshotInner.java | 94 + .../implementation/SnapshotsImpl.java | 85 + .../implementation/SnapshotsInner.java | 962 +++++++ .../implementation/VolumeImpl.java | 315 +++ .../implementation/VolumeInner.java | 399 +++ .../implementation/VolumesImpl.java | 128 + .../implementation/VolumesInner.java | 2407 +++++++++++++++++ .../implementation/package-info.java | 11 + .../netapp/v2020_03_01/package-info.java | 11 + 73 files changed, 12583 insertions(+) create mode 100644 sdk/netapp/mgmt-v2020_03_01/pom.xml create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Accounts.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ActiveDirectory.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/AuthorizeRequest.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPool.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPoolPatch.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CheckNameResourceTypes.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Dimension.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/EndpointType.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ExportPolicyRule.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/InAvailabilityReasonType.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MetricSpecification.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MirrorState.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTarget.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTargetProperties.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccount.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccountPatch.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppResources.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operation.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/OperationDisplay.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operations.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/PatchServiceLevel.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Pools.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/RelationshipStatus.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationObject.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationSchedule.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationStatus.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailability.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailabilityRequest.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceLevel.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceSpecification.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshot.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshots.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volume.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatch.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatchPropertiesExportPolicy.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesDataProtection.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesExportPolicy.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeRevert.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeSnapshotProperties.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volumes.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AzureNetAppFilesManagementClientImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/IdParsingUtils.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppManager.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PageImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesImpl.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesInner.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/package-info.java create mode 100644 sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/package-info.java diff --git a/sdk/netapp/mgmt-v2020_03_01/pom.xml b/sdk/netapp/mgmt-v2020_03_01/pom.xml new file mode 100644 index 0000000000000..36bc7ba355a82 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.netapp.v2020_03_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-netapp + 1.0.0-beta + jar + Microsoft Azure SDK for NetApp Management + This package contains Microsoft NetApp Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Accounts.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Accounts.java new file mode 100644 index 0000000000000..325315f833117 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Accounts.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.AccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Accounts. + */ +public interface Accounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, HasInner { +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ActiveDirectory.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ActiveDirectory.java new file mode 100644 index 0000000000000..cb795ece341f1 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ActiveDirectory.java @@ -0,0 +1,282 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Active Directory. + */ +public class ActiveDirectory { + /** + * Id of the Active Directory. + */ + @JsonProperty(value = "activeDirectoryId") + private String activeDirectoryId; + + /** + * Username of Active Directory domain administrator. + */ + @JsonProperty(value = "username") + private String username; + + /** + * Plain text password of Active Directory domain administrator. + */ + @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") + private String status; + + /** + * 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; + + /** + * Get id of the Active Directory. + * + * @return the activeDirectoryId value + */ + public String activeDirectoryId() { + return this.activeDirectoryId; + } + + /** + * Set id of the Active Directory. + * + * @param activeDirectoryId the activeDirectoryId value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withActiveDirectoryId(String activeDirectoryId) { + this.activeDirectoryId = activeDirectoryId; + return this; + } + + /** + * Get username of Active Directory domain administrator. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set username of Active Directory domain administrator. + * + * @param username the username value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get plain text password of Active Directory domain administrator. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set plain text password of Active Directory domain administrator. + * + * @param password the password value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get name of the Active Directory domain. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set name of the Active Directory domain. + * + * @param domain the domain value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain. + * + * @return the dns value + */ + public String dns() { + return this.dns; + } + + /** + * Set comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain. + * + * @param dns the dns value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withDns(String dns) { + this.dns = dns; + return this; + } + + /** + * Get status of the Active Directory. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set status of the Active Directory. + * + * @param status the status value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get netBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes. + * + * @return the smbServerName value + */ + public String smbServerName() { + return this.smbServerName; + } + + /** + * Set netBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes. + * + * @param smbServerName the smbServerName value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withSmbServerName(String smbServerName) { + this.smbServerName = smbServerName; + return this; + } + + /** + * Get the Organizational Unit (OU) within the Windows Active Directory. + * + * @return the organizationalUnit value + */ + public String organizationalUnit() { + return this.organizationalUnit; + } + + /** + * Set the Organizational Unit (OU) within the Windows Active Directory. + * + * @param organizationalUnit the organizationalUnit value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withOrganizationalUnit(String organizationalUnit) { + this.organizationalUnit = organizationalUnit; + return this; + } + + /** + * Get the Active Directory site the service will limit Domain Controller discovery to. + * + * @return the site value + */ + public String site() { + return this.site; + } + + /** + * Set the Active Directory site the service will limit Domain Controller discovery to. + * + * @param site the site value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withSite(String site) { + this.site = site; + return this; + } + + /** + * Get users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier. + * + * @return the backupOperators value + */ + public List backupOperators() { + return this.backupOperators; + } + + /** + * Set users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier. + * + * @param backupOperators the backupOperators value to set + * @return the ActiveDirectory object itself. + */ + public ActiveDirectory withBackupOperators(List backupOperators) { + this.backupOperators = backupOperators; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/AuthorizeRequest.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/AuthorizeRequest.java new file mode 100644 index 0000000000000..995d5c1c7a17f --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/AuthorizeRequest.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Authorize request. + */ +public class AuthorizeRequest { + /** + * Resource id of the remote volume. + */ + @JsonProperty(value = "remoteVolumeResourceId") + private String remoteVolumeResourceId; + + /** + * Get resource id of the remote volume. + * + * @return the remoteVolumeResourceId value + */ + public String remoteVolumeResourceId() { + return this.remoteVolumeResourceId; + } + + /** + * Set resource id of the remote volume. + * + * @param remoteVolumeResourceId the remoteVolumeResourceId value to set + * @return the AuthorizeRequest object itself. + */ + public AuthorizeRequest withRemoteVolumeResourceId(String remoteVolumeResourceId) { + this.remoteVolumeResourceId = remoteVolumeResourceId; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPool.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPool.java new file mode 100644 index 0000000000000..3a729b6ddff1c --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPool.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.CapacityPoolInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppManager; +import java.util.Map; + +/** + * Type representing CapacityPool. + */ +public interface CapacityPool extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the poolId value. + */ + String poolId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the serviceLevel value. + */ + ServiceLevel serviceLevel(); + + /** + * @return the size value. + */ + long size(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CapacityPool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithNetAppAccount, DefinitionStages.WithLocation, DefinitionStages.WithServiceLevel, DefinitionStages.WithSize, DefinitionStages.WithCreate { + } + + /** + * Grouping of CapacityPool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CapacityPool definition. + */ + interface Blank extends WithNetAppAccount { + } + + /** + * The stage of the capacitypool definition allowing to specify NetAppAccount. + */ + interface WithNetAppAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @return the next definition stage + */ + WithLocation withExistingNetAppAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the capacitypool definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the location parameter value + * @return the next definition stage + */ + WithServiceLevel withLocation(String location); + } + + /** + * The stage of the capacitypool definition allowing to specify ServiceLevel. + */ + interface WithServiceLevel { + /** + * Specifies serviceLevel. + * @param serviceLevel The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + * @return the next definition stage + */ + WithSize withServiceLevel(ServiceLevel serviceLevel); + } + + /** + * The stage of the capacitypool definition allowing to specify Size. + */ + interface WithSize { + /** + * Specifies size. + * @param size Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104) + * @return the next definition stage + */ + WithCreate withSize(long size); + } + + /** + * The stage of the capacitypool definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTags { + } + } + /** + * The template for a CapacityPool update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithServiceLevel, UpdateStages.WithSize, UpdateStages.WithTags { + } + + /** + * Grouping of CapacityPool update stages. + */ + interface UpdateStages { + /** + * The stage of the capacitypool update allowing to specify ServiceLevel. + */ + interface WithServiceLevel { + /** + * Specifies serviceLevel. + * @param serviceLevel The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + * @return the next update stage + */ + Update withServiceLevel(PatchServiceLevel serviceLevel); + } + + /** + * The stage of the capacitypool update allowing to specify Size. + */ + interface WithSize { + /** + * Specifies size. + * @param size Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104) + * @return the next update stage + */ + Update withSize(Long size); + } + + /** + * The stage of the capacitypool update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPoolPatch.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPoolPatch.java new file mode 100644 index 0000000000000..c18888bd8af79 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CapacityPoolPatch.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Capacity pool patch resource. + */ +@JsonFlatten +public class CapacityPoolPatch extends Resource { + /** + * size. + * Provisioned size of the pool (in bytes). Allowed values are in 4TiB + * chunks (value must be multiply of 4398046511104). + */ + @JsonProperty(value = "properties.size") + private Long size; + + /** + * serviceLevel. + * The service level of the file system. Possible values include: + * 'Standard', 'Premium', 'Ultra'. + */ + @JsonProperty(value = "properties.serviceLevel") + private PatchServiceLevel serviceLevel; + + /** + * Get provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Set provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @param size the size value to set + * @return the CapacityPoolPatch object itself. + */ + public CapacityPoolPatch withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @return the serviceLevel value + */ + public PatchServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @param serviceLevel the serviceLevel value to set + * @return the CapacityPoolPatch object itself. + */ + public CapacityPoolPatch withServiceLevel(PatchServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CheckNameResourceTypes.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CheckNameResourceTypes.java new file mode 100644 index 0000000000000..5f3dfd695e741 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/CheckNameResourceTypes.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CheckNameResourceTypes. + */ +public final class CheckNameResourceTypes extends ExpandableStringEnum { + /** Static value Microsoft.NetApp/netAppAccounts for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTS = fromString("Microsoft.NetApp/netAppAccounts"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLS = fromString("Microsoft.NetApp/netAppAccounts/capacityPools"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLSVOLUMES = fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"); + + /** Static value Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots for CheckNameResourceTypes. */ + public static final CheckNameResourceTypes MICROSOFT_NET_APPNET_APP_ACCOUNTSCAPACITY_POOLSVOLUMESSNAPSHOTS = fromString("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"); + + /** + * Creates or finds a CheckNameResourceTypes from its string representation. + * @param name a name to look for + * @return the corresponding CheckNameResourceTypes + */ + @JsonCreator + public static CheckNameResourceTypes fromString(String name) { + return fromString(name, CheckNameResourceTypes.class); + } + + /** + * @return known CheckNameResourceTypes values + */ + public static Collection values() { + return values(CheckNameResourceTypes.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Dimension.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Dimension.java new file mode 100644 index 0000000000000..dafce53a8ae69 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Dimension.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of blobs, possibly be blob type or access tier. + */ +public class Dimension { + /** + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get display name of dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set display name of dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/EndpointType.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/EndpointType.java new file mode 100644 index 0000000000000..26b8444f80493 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/EndpointType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EndpointType. + */ +public final class EndpointType extends ExpandableStringEnum { + /** Static value src for EndpointType. */ + public static final EndpointType SRC = fromString("src"); + + /** Static value dst for EndpointType. */ + public static final EndpointType DST = fromString("dst"); + + /** + * Creates or finds a EndpointType from its string representation. + * @param name a name to look for + * @return the corresponding EndpointType + */ + @JsonCreator + public static EndpointType fromString(String name) { + return fromString(name, EndpointType.class); + } + + /** + * @return known EndpointType values + */ + public static Collection values() { + return values(EndpointType.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ExportPolicyRule.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ExportPolicyRule.java new file mode 100644 index 0000000000000..c960e0ca91ddd --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ExportPolicyRule.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Volume Export Policy Rule. + */ +public class ExportPolicyRule { + /** + * Order index. + */ + @JsonProperty(value = "ruleIndex") + private Integer ruleIndex; + + /** + * Read only access. + */ + @JsonProperty(value = "unixReadOnly") + private Boolean unixReadOnly; + + /** + * Read and write access. + */ + @JsonProperty(value = "unixReadWrite") + private Boolean unixReadWrite; + + /** + * 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; + + /** + * Get order index. + * + * @return the ruleIndex value + */ + public Integer ruleIndex() { + return this.ruleIndex; + } + + /** + * Set order index. + * + * @param ruleIndex the ruleIndex value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withRuleIndex(Integer ruleIndex) { + this.ruleIndex = ruleIndex; + return this; + } + + /** + * Get read only access. + * + * @return the unixReadOnly value + */ + public Boolean unixReadOnly() { + return this.unixReadOnly; + } + + /** + * Set read only access. + * + * @param unixReadOnly the unixReadOnly value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withUnixReadOnly(Boolean unixReadOnly) { + this.unixReadOnly = unixReadOnly; + return this; + } + + /** + * Get read and write access. + * + * @return the unixReadWrite value + */ + public Boolean unixReadWrite() { + return this.unixReadWrite; + } + + /** + * Set read and write access. + * + * @param unixReadWrite the unixReadWrite value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withUnixReadWrite(Boolean unixReadWrite) { + this.unixReadWrite = unixReadWrite; + return this; + } + + /** + * Get allows CIFS protocol. + * + * @return the cifs value + */ + public Boolean cifs() { + return this.cifs; + } + + /** + * Set allows CIFS protocol. + * + * @param cifs the cifs value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withCifs(Boolean cifs) { + this.cifs = cifs; + return this; + } + + /** + * Get allows NFSv3 protocol. Enable only for NFSv3 type volumes. + * + * @return the nfsv3 value + */ + public Boolean nfsv3() { + return this.nfsv3; + } + + /** + * Set allows NFSv3 protocol. Enable only for NFSv3 type volumes. + * + * @param nfsv3 the nfsv3 value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withNfsv3(Boolean nfsv3) { + this.nfsv3 = nfsv3; + return this; + } + + /** + * Get allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes. + * + * @return the nfsv41 value + */ + public Boolean nfsv41() { + return this.nfsv41; + } + + /** + * Set allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes. + * + * @param nfsv41 the nfsv41 value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withNfsv41(Boolean nfsv41) { + this.nfsv41 = nfsv41; + return this; + } + + /** + * Get client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names. + * + * @return the allowedClients value + */ + public String allowedClients() { + return this.allowedClients; + } + + /** + * Set client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names. + * + * @param allowedClients the allowedClients value to set + * @return the ExportPolicyRule object itself. + */ + public ExportPolicyRule withAllowedClients(String allowedClients) { + this.allowedClients = allowedClients; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/InAvailabilityReasonType.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/InAvailabilityReasonType.java new file mode 100644 index 0000000000000..7fe499db4f950 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/InAvailabilityReasonType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InAvailabilityReasonType. + */ +public final class InAvailabilityReasonType extends ExpandableStringEnum { + /** Static value Invalid for InAvailabilityReasonType. */ + public static final InAvailabilityReasonType INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for InAvailabilityReasonType. */ + public static final InAvailabilityReasonType ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a InAvailabilityReasonType from its string representation. + * @param name a name to look for + * @return the corresponding InAvailabilityReasonType + */ + @JsonCreator + public static InAvailabilityReasonType fromString(String name) { + return fromString(name, InAvailabilityReasonType.class); + } + + /** + * @return known InAvailabilityReasonType values + */ + public static Collection values() { + return values(InAvailabilityReasonType.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MetricSpecification.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MetricSpecification.java new file mode 100644 index 0000000000000..88af31c276b53 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MetricSpecification.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric specification of operation. + */ +public class MetricSpecification { + /** + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit could be Bytes or Count. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Dimensions of blobs, including blob type and access tier. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Aggregation type could be Average. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * The property to decide fill gap with zero or not. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * The category this metric specification belong to, could be Capacity. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Account Resource Id. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get name of metric specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of metric specification. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of metric specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of metric specification. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get display description of metric specification. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set display description of metric specification. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit could be Bytes or Count. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit could be Bytes or Count. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of blobs, including blob type and access tier. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get aggregation type could be Average. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set aggregation type could be Average. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the property to decide fill gap with zero or not. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category this metric specification belong to, could be Capacity. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category this metric specification belong to, could be Capacity. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get account Resource Id. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set account Resource Id. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MirrorState.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MirrorState.java new file mode 100644 index 0000000000000..b5b4f73302aad --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MirrorState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MirrorState. + */ +public final class MirrorState extends ExpandableStringEnum { + /** Static value Uninitialized for MirrorState. */ + public static final MirrorState UNINITIALIZED = fromString("Uninitialized"); + + /** Static value Mirrored for MirrorState. */ + public static final MirrorState MIRRORED = fromString("Mirrored"); + + /** Static value Broken for MirrorState. */ + public static final MirrorState BROKEN = fromString("Broken"); + + /** + * Creates or finds a MirrorState from its string representation. + * @param name a name to look for + * @return the corresponding MirrorState + */ + @JsonCreator + public static MirrorState fromString(String name) { + return fromString(name, MirrorState.class); + } + + /** + * @return known MirrorState values + */ + public static Collection values() { + return values(MirrorState.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTarget.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTarget.java new file mode 100644 index 0000000000000..c20c93bbf2075 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTarget.java @@ -0,0 +1,340 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Mount Target. + */ +@JsonFlatten +public class MountTarget { + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * mountTargetId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "properties.mountTargetId", access = JsonProperty.Access.WRITE_ONLY) + private String mountTargetId; + + /** + * fileSystemId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "properties.fileSystemId", required = true) + private String fileSystemId; + + /** + * ipAddress. + * The mount target's IPv4 address. + */ + @JsonProperty(value = "properties.ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * subnet. + * The subnet. + */ + @JsonProperty(value = "properties.subnet") + private String subnet; + + /** + * startIp. + * The start of IPv4 address range to use when creating a new mount target. + */ + @JsonProperty(value = "properties.startIp") + private String startIp; + + /** + * endIp. + * The end of IPv4 address range to use when creating a new mount target. + */ + @JsonProperty(value = "properties.endIp") + private String endIp; + + /** + * gateway. + * The gateway of the IPv4 address range to use when creating a new mount + * target. + */ + @JsonProperty(value = "properties.gateway") + private String gateway; + + /** + * netmask. + * The netmask of the IPv4 address range to use when creating a new mount + * target. + */ + @JsonProperty(value = "properties.netmask") + private String netmask; + + /** + * smbServerFQDN. + * The SMB server's Fully Qualified Domain Name, FQDN. + */ + @JsonProperty(value = "properties.smbServerFqdn") + private String smbServerFqdn; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the MountTarget object itself. + */ + public MountTarget withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the MountTarget object itself. + */ + public MountTarget withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the mountTargetId value + */ + public String mountTargetId() { + return this.mountTargetId; + } + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the fileSystemId value + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set uUID v4 used to identify the MountTarget. + * + * @param fileSystemId the fileSystemId value to set + * @return the MountTarget object itself. + */ + public MountTarget withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the mount target's IPv4 address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the subnet. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the subnet. + * + * @param subnet the subnet value to set + * @return the MountTarget object itself. + */ + public MountTarget withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the start of IPv4 address range to use when creating a new mount target. + * + * @return the startIp value + */ + public String startIp() { + return this.startIp; + } + + /** + * Set the start of IPv4 address range to use when creating a new mount target. + * + * @param startIp the startIp value to set + * @return the MountTarget object itself. + */ + public MountTarget withStartIp(String startIp) { + this.startIp = startIp; + return this; + } + + /** + * Get the end of IPv4 address range to use when creating a new mount target. + * + * @return the endIp value + */ + public String endIp() { + return this.endIp; + } + + /** + * Set the end of IPv4 address range to use when creating a new mount target. + * + * @param endIp the endIp value to set + * @return the MountTarget object itself. + */ + public MountTarget withEndIp(String endIp) { + this.endIp = endIp; + return this; + } + + /** + * Get the gateway of the IPv4 address range to use when creating a new mount target. + * + * @return the gateway value + */ + public String gateway() { + return this.gateway; + } + + /** + * Set the gateway of the IPv4 address range to use when creating a new mount target. + * + * @param gateway the gateway value to set + * @return the MountTarget object itself. + */ + public MountTarget withGateway(String gateway) { + this.gateway = gateway; + return this; + } + + /** + * Get the netmask of the IPv4 address range to use when creating a new mount target. + * + * @return the netmask value + */ + public String netmask() { + return this.netmask; + } + + /** + * Set the netmask of the IPv4 address range to use when creating a new mount target. + * + * @param netmask the netmask value to set + * @return the MountTarget object itself. + */ + public MountTarget withNetmask(String netmask) { + this.netmask = netmask; + return this; + } + + /** + * Get the SMB server's Fully Qualified Domain Name, FQDN. + * + * @return the smbServerFqdn value + */ + public String smbServerFqdn() { + return this.smbServerFqdn; + } + + /** + * Set the SMB server's Fully Qualified Domain Name, FQDN. + * + * @param smbServerFqdn the smbServerFqdn value to set + * @return the MountTarget object itself. + */ + public MountTarget withSmbServerFqdn(String smbServerFqdn) { + this.smbServerFqdn = smbServerFqdn; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTargetProperties.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTargetProperties.java new file mode 100644 index 0000000000000..237540eb58203 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/MountTargetProperties.java @@ -0,0 +1,240 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Mount target properties. + */ +public class MountTargetProperties { + /** + * mountTargetId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "mountTargetId", access = JsonProperty.Access.WRITE_ONLY) + private String mountTargetId; + + /** + * fileSystemId. + * UUID v4 used to identify the MountTarget. + */ + @JsonProperty(value = "fileSystemId", required = true) + private String fileSystemId; + + /** + * ipAddress. + * The mount target's IPv4 address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * subnet. + * The subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /** + * startIp. + * The start of IPv4 address range to use when creating a new mount target. + */ + @JsonProperty(value = "startIp") + private String startIp; + + /** + * endIp. + * The end of IPv4 address range to use when creating a new mount target. + */ + @JsonProperty(value = "endIp") + private String endIp; + + /** + * gateway. + * The gateway of the IPv4 address range to use when creating a new mount + * target. + */ + @JsonProperty(value = "gateway") + private String gateway; + + /** + * netmask. + * The netmask of the IPv4 address range to use when creating a new mount + * target. + */ + @JsonProperty(value = "netmask") + private String netmask; + + /** + * smbServerFQDN. + * The SMB server's Fully Qualified Domain Name, FQDN. + */ + @JsonProperty(value = "smbServerFqdn") + private String smbServerFqdn; + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the mountTargetId value + */ + public String mountTargetId() { + return this.mountTargetId; + } + + /** + * Get uUID v4 used to identify the MountTarget. + * + * @return the fileSystemId value + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set uUID v4 used to identify the MountTarget. + * + * @param fileSystemId the fileSystemId value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the mount target's IPv4 address. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the subnet. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the subnet. + * + * @param subnet the subnet value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the start of IPv4 address range to use when creating a new mount target. + * + * @return the startIp value + */ + public String startIp() { + return this.startIp; + } + + /** + * Set the start of IPv4 address range to use when creating a new mount target. + * + * @param startIp the startIp value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withStartIp(String startIp) { + this.startIp = startIp; + return this; + } + + /** + * Get the end of IPv4 address range to use when creating a new mount target. + * + * @return the endIp value + */ + public String endIp() { + return this.endIp; + } + + /** + * Set the end of IPv4 address range to use when creating a new mount target. + * + * @param endIp the endIp value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withEndIp(String endIp) { + this.endIp = endIp; + return this; + } + + /** + * Get the gateway of the IPv4 address range to use when creating a new mount target. + * + * @return the gateway value + */ + public String gateway() { + return this.gateway; + } + + /** + * Set the gateway of the IPv4 address range to use when creating a new mount target. + * + * @param gateway the gateway value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withGateway(String gateway) { + this.gateway = gateway; + return this; + } + + /** + * Get the netmask of the IPv4 address range to use when creating a new mount target. + * + * @return the netmask value + */ + public String netmask() { + return this.netmask; + } + + /** + * Set the netmask of the IPv4 address range to use when creating a new mount target. + * + * @param netmask the netmask value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withNetmask(String netmask) { + this.netmask = netmask; + return this; + } + + /** + * Get the SMB server's Fully Qualified Domain Name, FQDN. + * + * @return the smbServerFqdn value + */ + public String smbServerFqdn() { + return this.smbServerFqdn; + } + + /** + * Set the SMB server's Fully Qualified Domain Name, FQDN. + * + * @param smbServerFqdn the smbServerFqdn value to set + * @return the MountTargetProperties object itself. + */ + public MountTargetProperties withSmbServerFqdn(String smbServerFqdn) { + this.smbServerFqdn = smbServerFqdn; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccount.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccount.java new file mode 100644 index 0000000000000..22b3637c37ea2 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccount.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppManager; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppAccountInner; + +/** + * Type representing NetAppAccount. + */ +public interface NetAppAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the activeDirectories value. + */ + List activeDirectories(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * The entirety of the NetAppAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of NetAppAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NetAppAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the NetAppAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the netappaccount definition allowing to specify ActiveDirectories. + */ + interface WithActiveDirectories { + /** + * Specifies activeDirectories. + * @param activeDirectories Active Directories + * @return the next definition stage + */ + WithCreate withActiveDirectories(List activeDirectories); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithActiveDirectories { + } + } + /** + * The template for a NetAppAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithActiveDirectories { + } + + /** + * Grouping of NetAppAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the netappaccount update allowing to specify ActiveDirectories. + */ + interface WithActiveDirectories { + /** + * Specifies activeDirectories. + * @param activeDirectories Active Directories + * @return the next update stage + */ + Update withActiveDirectories(List activeDirectories); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccountPatch.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccountPatch.java new file mode 100644 index 0000000000000..a19f3482649ba --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppAccountPatch.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * NetApp account patch resource. + */ +@JsonFlatten +public class NetAppAccountPatch extends Resource { + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Active Directories. + */ + @JsonProperty(value = "properties.activeDirectories") + private List activeDirectories; + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get active Directories. + * + * @return the activeDirectories value + */ + public List activeDirectories() { + return this.activeDirectories; + } + + /** + * Set active Directories. + * + * @param activeDirectories the activeDirectories value to set + * @return the NetAppAccountPatch object itself. + */ + public NetAppAccountPatch withActiveDirectories(List activeDirectories) { + this.activeDirectories = activeDirectories; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppResources.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppResources.java new file mode 100644 index 0000000000000..dbd2f164af601 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/NetAppResources.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NetAppResources. + */ +public interface NetAppResources extends HasInner { + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup); + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operation.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operation.java new file mode 100644 index 0000000000000..ee28118237fa6 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/OperationDisplay.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/OperationDisplay.java new file mode 100644 index 0000000000000..2b762e5fa7a7a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft NetApp. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft NetApp. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft NetApp. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set operation description. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operations.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operations.java new file mode 100644 index 0000000000000..9877fbeb101b4 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/PatchServiceLevel.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/PatchServiceLevel.java new file mode 100644 index 0000000000000..b7adaf674d3d3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/PatchServiceLevel.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PatchServiceLevel. + */ +public final class PatchServiceLevel extends ExpandableStringEnum { + /** Static value Standard for PatchServiceLevel. */ + public static final PatchServiceLevel STANDARD = fromString("Standard"); + + /** Static value Premium for PatchServiceLevel. */ + public static final PatchServiceLevel PREMIUM = fromString("Premium"); + + /** Static value Ultra for PatchServiceLevel. */ + public static final PatchServiceLevel ULTRA = fromString("Ultra"); + + /** + * Creates or finds a PatchServiceLevel from its string representation. + * @param name a name to look for + * @return the corresponding PatchServiceLevel + */ + @JsonCreator + public static PatchServiceLevel fromString(String name) { + return fromString(name, PatchServiceLevel.class); + } + + /** + * @return known PatchServiceLevel values + */ + public static Collection values() { + return values(PatchServiceLevel.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Pools.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Pools.java new file mode 100644 index 0000000000000..6958c43da7ad1 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Pools.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.PoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Pools. + */ +public interface Pools extends SupportsCreating, HasInner { + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName); + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/RelationshipStatus.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/RelationshipStatus.java new file mode 100644 index 0000000000000..efc160a78d193 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/RelationshipStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RelationshipStatus. + */ +public final class RelationshipStatus extends ExpandableStringEnum { + /** Static value Idle for RelationshipStatus. */ + public static final RelationshipStatus IDLE = fromString("Idle"); + + /** Static value Transferring for RelationshipStatus. */ + public static final RelationshipStatus TRANSFERRING = fromString("Transferring"); + + /** + * Creates or finds a RelationshipStatus from its string representation. + * @param name a name to look for + * @return the corresponding RelationshipStatus + */ + @JsonCreator + public static RelationshipStatus fromString(String name) { + return fromString(name, RelationshipStatus.class); + } + + /** + * @return known RelationshipStatus values + */ + public static Collection values() { + return values(RelationshipStatus.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationObject.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationObject.java new file mode 100644 index 0000000000000..f7902468d04a5 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationObject.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Replication properties. + */ +public class ReplicationObject { + /** + * Id. + */ + @JsonProperty(value = "replicationId") + private String replicationId; + + /** + * Indicates whether the local volume is the source or destination for the + * Volume Replication. Possible values include: 'src', 'dst'. + */ + @JsonProperty(value = "endpointType") + private EndpointType endpointType; + + /** + * Schedule. Possible values include: '_10minutely', 'hourly', 'daily', + * 'weekly', 'monthly'. + */ + @JsonProperty(value = "replicationSchedule", required = true) + private ReplicationSchedule replicationSchedule; + + /** + * The resource ID of the remote volume. + */ + @JsonProperty(value = "remoteVolumeResourceId", required = true) + private String remoteVolumeResourceId; + + /** + * The remote region for the other end of the Volume Replication. + */ + @JsonProperty(value = "remoteVolumeRegion") + private String remoteVolumeRegion; + + /** + * Get id. + * + * @return the replicationId value + */ + public String replicationId() { + return this.replicationId; + } + + /** + * Set id. + * + * @param replicationId the replicationId value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withReplicationId(String replicationId) { + this.replicationId = replicationId; + return this; + } + + /** + * Get indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'src', 'dst'. + * + * @return the endpointType value + */ + public EndpointType endpointType() { + return this.endpointType; + } + + /** + * Set indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'src', 'dst'. + * + * @param endpointType the endpointType value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withEndpointType(EndpointType endpointType) { + this.endpointType = endpointType; + return this; + } + + /** + * Get schedule. Possible values include: '_10minutely', 'hourly', 'daily', 'weekly', 'monthly'. + * + * @return the replicationSchedule value + */ + public ReplicationSchedule replicationSchedule() { + return this.replicationSchedule; + } + + /** + * Set schedule. Possible values include: '_10minutely', 'hourly', 'daily', 'weekly', 'monthly'. + * + * @param replicationSchedule the replicationSchedule value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withReplicationSchedule(ReplicationSchedule replicationSchedule) { + this.replicationSchedule = replicationSchedule; + return this; + } + + /** + * Get the resource ID of the remote volume. + * + * @return the remoteVolumeResourceId value + */ + public String remoteVolumeResourceId() { + return this.remoteVolumeResourceId; + } + + /** + * Set the resource ID of the remote volume. + * + * @param remoteVolumeResourceId the remoteVolumeResourceId value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withRemoteVolumeResourceId(String remoteVolumeResourceId) { + this.remoteVolumeResourceId = remoteVolumeResourceId; + return this; + } + + /** + * Get the remote region for the other end of the Volume Replication. + * + * @return the remoteVolumeRegion value + */ + public String remoteVolumeRegion() { + return this.remoteVolumeRegion; + } + + /** + * Set the remote region for the other end of the Volume Replication. + * + * @param remoteVolumeRegion the remoteVolumeRegion value to set + * @return the ReplicationObject object itself. + */ + public ReplicationObject withRemoteVolumeRegion(String remoteVolumeRegion) { + this.remoteVolumeRegion = remoteVolumeRegion; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationSchedule.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationSchedule.java new file mode 100644 index 0000000000000..dbf10fc182852 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationSchedule.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReplicationSchedule. + */ +public final class ReplicationSchedule extends ExpandableStringEnum { + /** Static value _10minutely for ReplicationSchedule. */ + public static final ReplicationSchedule _10MINUTELY = fromString("_10minutely"); + + /** Static value hourly for ReplicationSchedule. */ + public static final ReplicationSchedule HOURLY = fromString("hourly"); + + /** Static value daily for ReplicationSchedule. */ + public static final ReplicationSchedule DAILY = fromString("daily"); + + /** Static value weekly for ReplicationSchedule. */ + public static final ReplicationSchedule WEEKLY = fromString("weekly"); + + /** Static value monthly for ReplicationSchedule. */ + public static final ReplicationSchedule MONTHLY = fromString("monthly"); + + /** + * Creates or finds a ReplicationSchedule from its string representation. + * @param name a name to look for + * @return the corresponding ReplicationSchedule + */ + @JsonCreator + public static ReplicationSchedule fromString(String name) { + return fromString(name, ReplicationSchedule.class); + } + + /** + * @return known ReplicationSchedule values + */ + public static Collection values() { + return values(ReplicationSchedule.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationStatus.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationStatus.java new file mode 100644 index 0000000000000..e3a13be72244a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ReplicationStatus.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.ReplicationStatusInner; + +/** + * Type representing ReplicationStatus. + */ +public interface ReplicationStatus extends HasInner, HasManager { + /** + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * @return the healthy value. + */ + Boolean healthy(); + + /** + * @return the mirrorState value. + */ + MirrorState mirrorState(); + + /** + * @return the relationshipStatus value. + */ + RelationshipStatus relationshipStatus(); + + /** + * @return the totalProgress value. + */ + String totalProgress(); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailability.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailability.java new file mode 100644 index 0000000000000..0bf3c5eb9e58d --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailability.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.ResourceNameAvailabilityInner; + +/** + * Type representing ResourceNameAvailability. + */ +public interface ResourceNameAvailability extends HasInner, HasManager { + /** + * @return the isAvailable value. + */ + Boolean isAvailable(); + + /** + * @return the message value. + */ + String message(); + + /** + * @return the reason value. + */ + InAvailabilityReasonType reason(); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailabilityRequest.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailabilityRequest.java new file mode 100644 index 0000000000000..964e6252963fc --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ResourceNameAvailabilityRequest.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource name availability request content. + */ +public class ResourceNameAvailabilityRequest { + /** + * Resource name to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Resource type used for verification. Possible values include: + * 'Microsoft.NetApp/netAppAccounts', + * 'Microsoft.NetApp/netAppAccounts/capacityPools', + * 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', + * 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + */ + @JsonProperty(value = "type", required = true) + private CheckNameResourceTypes type; + + /** + * Resource group name. + */ + @JsonProperty(value = "resourceGroup", required = true) + private String resourceGroup; + + /** + * Get resource name to verify. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name to verify. + * + * @param name the name value to set + * @return the ResourceNameAvailabilityRequest object itself. + */ + public ResourceNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + * + * @return the type value + */ + public CheckNameResourceTypes type() { + return this.type; + } + + /** + * Set resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'. + * + * @param type the type value to set + * @return the ResourceNameAvailabilityRequest object itself. + */ + public ResourceNameAvailabilityRequest withType(CheckNameResourceTypes type) { + this.type = type; + return this; + } + + /** + * Get resource group name. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set resource group name. + * + * @param resourceGroup the resourceGroup value to set + * @return the ResourceNameAvailabilityRequest object itself. + */ + public ResourceNameAvailabilityRequest withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceLevel.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceLevel.java new file mode 100644 index 0000000000000..0e52887e212ec --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceLevel.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceLevel. + */ +public final class ServiceLevel extends ExpandableStringEnum { + /** Static value Standard for ServiceLevel. */ + public static final ServiceLevel STANDARD = fromString("Standard"); + + /** Static value Premium for ServiceLevel. */ + public static final ServiceLevel PREMIUM = fromString("Premium"); + + /** Static value Ultra for ServiceLevel. */ + public static final ServiceLevel ULTRA = fromString("Ultra"); + + /** + * Creates or finds a ServiceLevel from its string representation. + * @param name a name to look for + * @return the corresponding ServiceLevel + */ + @JsonCreator + public static ServiceLevel fromString(String name) { + return fromString(name, ServiceLevel.class); + } + + /** + * @return known ServiceLevel values + */ + public static Collection values() { + return values(ServiceLevel.class); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceSpecification.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceSpecification.java new file mode 100644 index 0000000000000..d336ed8a51638 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/ServiceSpecification.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * One property of operation, include metric specifications. + */ +public class ServiceSpecification { + /** + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get metric specifications of operation. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshot.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshot.java new file mode 100644 index 0000000000000..20ca98ba33b27 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshot.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.SnapshotInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppManager; +import org.joda.time.DateTime; + +/** + * Type representing Snapshot. + */ +public interface Snapshot extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the snapshotId value. + */ + String snapshotId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Snapshot definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVolume, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of Snapshot definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Snapshot definition. + */ + interface Blank extends WithVolume { + } + + /** + * The stage of the snapshot definition allowing to specify Volume. + */ + interface WithVolume { + /** + * Specifies resourceGroupName, accountName, poolName, volumeName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @return the next definition stage + */ + WithLocation withExistingVolume(String resourceGroupName, String accountName, String poolName, String volumeName); + } + + /** + * The stage of the snapshot definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a Snapshot update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithBody { + } + + /** + * Grouping of Snapshot update stages. + */ + interface UpdateStages { + /** + * The stage of the snapshot update allowing to specify Body. + */ + interface WithBody { + /** + * Specifies body. + * @param body Snapshot object supplied in the body of the operation + * @return the next update stage + */ + Update withBody(Object body); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshots.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshots.java new file mode 100644 index 0000000000000..f3448883eb397 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Snapshots.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.SnapshotsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Snapshots. + */ +public interface Snapshots extends SupportsCreating, HasInner { + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volume.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volume.java new file mode 100644 index 0000000000000..d54d4aff484b0 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volume.java @@ -0,0 +1,392 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.VolumeInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.NetAppManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing Volume. + */ +public interface Volume extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the baremetalTenantId value. + */ + String baremetalTenantId(); + + /** + * @return the creationToken value. + */ + String creationToken(); + + /** + * @return the dataProtection value. + */ + VolumePropertiesDataProtection dataProtection(); + + /** + * @return the exportPolicy value. + */ + VolumePropertiesExportPolicy exportPolicy(); + + /** + * @return the fileSystemId value. + */ + String fileSystemId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isRestoring value. + */ + Boolean isRestoring(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mountTargets value. + */ + List mountTargets(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protocolTypes value. + */ + List protocolTypes(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the serviceLevel value. + */ + ServiceLevel serviceLevel(); + + /** + * @return the snapshotDirectoryVisible value. + */ + Boolean snapshotDirectoryVisible(); + + /** + * @return the snapshotId value. + */ + String snapshotId(); + + /** + * @return the subnetId value. + */ + String subnetId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the usageThreshold value. + */ + long usageThreshold(); + + /** + * @return the volumeType value. + */ + String volumeType(); + + /** + * The entirety of the Volume definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCapacityPool, DefinitionStages.WithCreationToken, DefinitionStages.WithLocation, DefinitionStages.WithSubnetId, DefinitionStages.WithUsageThreshold, DefinitionStages.WithCreate { + } + + /** + * Grouping of Volume definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Volume definition. + */ + interface Blank extends WithCapacityPool { + } + + /** + * The stage of the volume definition allowing to specify CapacityPool. + */ + interface WithCapacityPool { + /** + * Specifies resourceGroupName, accountName, poolName. + * @param resourceGroupName The name of the resource group + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @return the next definition stage + */ + WithCreationToken withExistingCapacityPool(String resourceGroupName, String accountName, String poolName); + } + + /** + * The stage of the volume definition allowing to specify CreationToken. + */ + interface WithCreationToken { + /** + * Specifies creationToken. + * @param creationToken A unique file path for the volume. Used when creating mount targets + * @return the next definition stage + */ + WithLocation withCreationToken(String creationToken); + } + + /** + * The stage of the volume definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location the location parameter value + * @return the next definition stage + */ + WithSubnetId withLocation(String location); + } + + /** + * The stage of the volume definition allowing to specify SubnetId. + */ + interface WithSubnetId { + /** + * Specifies subnetId. + * @param subnetId The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes + * @return the next definition stage + */ + WithUsageThreshold withSubnetId(String subnetId); + } + + /** + * The stage of the volume definition allowing to specify UsageThreshold. + */ + interface WithUsageThreshold { + /** + * Specifies usageThreshold. + * @param usageThreshold Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes + * @return the next definition stage + */ + WithCreate withUsageThreshold(long usageThreshold); + } + + /** + * The stage of the volume definition allowing to specify DataProtection. + */ + interface WithDataProtection { + /** + * Specifies dataProtection. + * @param dataProtection DataProtection type volumes include an object containing details of the replication + * @return the next definition stage + */ + WithCreate withDataProtection(VolumePropertiesDataProtection dataProtection); + } + + /** + * The stage of the volume definition allowing to specify ExportPolicy. + */ + interface WithExportPolicy { + /** + * Specifies exportPolicy. + * @param exportPolicy Set of export policy rules + * @return the next definition stage + */ + WithCreate withExportPolicy(VolumePropertiesExportPolicy exportPolicy); + } + + /** + * The stage of the volume definition allowing to specify IsRestoring. + */ + interface WithIsRestoring { + /** + * Specifies isRestoring. + * @param isRestoring Restoring + * @return the next definition stage + */ + WithCreate withIsRestoring(Boolean isRestoring); + } + + /** + * The stage of the volume definition allowing to specify MountTargets. + */ + interface WithMountTargets { + /** + * Specifies mountTargets. + * @param mountTargets List of mount targets + * @return the next definition stage + */ + WithCreate withMountTargets(List mountTargets); + } + + /** + * The stage of the volume definition allowing to specify ProtocolTypes. + */ + interface WithProtocolTypes { + /** + * Specifies protocolTypes. + * @param protocolTypes Set of protocol types + * @return the next definition stage + */ + WithCreate withProtocolTypes(List protocolTypes); + } + + /** + * The stage of the volume definition allowing to specify ServiceLevel. + */ + interface WithServiceLevel { + /** + * Specifies serviceLevel. + * @param serviceLevel The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + * @return the next definition stage + */ + WithCreate withServiceLevel(ServiceLevel serviceLevel); + } + + /** + * The stage of the volume definition allowing to specify SnapshotDirectoryVisible. + */ + interface WithSnapshotDirectoryVisible { + /** + * Specifies snapshotDirectoryVisible. + * @param snapshotDirectoryVisible If enabled (true) the volume will contain a read-only .snapshot directory which provides access to each of the volume's snapshots (default to true) + * @return the next definition stage + */ + WithCreate withSnapshotDirectoryVisible(Boolean snapshotDirectoryVisible); + } + + /** + * The stage of the volume definition allowing to specify SnapshotId. + */ + interface WithSnapshotId { + /** + * Specifies snapshotId. + * @param snapshotId UUID v4 or resource identifier used to identify the Snapshot + * @return the next definition stage + */ + WithCreate withSnapshotId(String snapshotId); + } + + /** + * The stage of the volume definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the volume definition allowing to specify VolumeType. + */ + interface WithVolumeType { + /** + * Specifies volumeType. + * @param volumeType What type of volume is this + * @return the next definition stage + */ + WithCreate withVolumeType(String volumeType); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDataProtection, DefinitionStages.WithExportPolicy, DefinitionStages.WithIsRestoring, DefinitionStages.WithMountTargets, DefinitionStages.WithProtocolTypes, DefinitionStages.WithServiceLevel, DefinitionStages.WithSnapshotDirectoryVisible, DefinitionStages.WithSnapshotId, DefinitionStages.WithTags, DefinitionStages.WithVolumeType { + } + } + /** + * The template for a Volume update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithExportPolicy, UpdateStages.WithServiceLevel, UpdateStages.WithTags, UpdateStages.WithUsageThreshold { + } + + /** + * Grouping of Volume update stages. + */ + interface UpdateStages { + /** + * The stage of the volume update allowing to specify ExportPolicy. + */ + interface WithExportPolicy { + /** + * Specifies exportPolicy. + * @param exportPolicy Set of export policy rules + * @return the next update stage + */ + Update withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy); + } + + /** + * The stage of the volume update allowing to specify ServiceLevel. + */ + interface WithServiceLevel { + /** + * Specifies serviceLevel. + * @param serviceLevel The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + * @return the next update stage + */ + Update withServiceLevel(ServiceLevel serviceLevel); + } + + /** + * The stage of the volume update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the volume update allowing to specify UsageThreshold. + */ + interface WithUsageThreshold { + /** + * Specifies usageThreshold. + * @param usageThreshold Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes + * @return the next update stage + */ + Update withUsageThreshold(Long usageThreshold); + } + + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatch.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatch.java new file mode 100644 index 0000000000000..9a33323c1ac42 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatch.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Volume patch resource. + */ +@JsonFlatten +public class VolumePatch extends Resource { + /** + * serviceLevel. + * The service level of the file system. Possible values include: + * 'Standard', 'Premium', 'Ultra'. + */ + @JsonProperty(value = "properties.serviceLevel") + private ServiceLevel serviceLevel; + + /** + * usageThreshold. + * Maximum storage quota allowed for a file system in bytes. This is a soft + * quota used for alerting only. Minimum size is 100 GiB. Upper limit is + * 100TiB. Specified in bytes. + */ + @JsonProperty(value = "properties.usageThreshold") + private Long usageThreshold; + + /** + * exportPolicy. + * Set of export policy rules. + */ + @JsonProperty(value = "properties.exportPolicy") + private VolumePatchPropertiesExportPolicy exportPolicy; + + /** + * Get the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @return the serviceLevel value + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @param serviceLevel the serviceLevel value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @return the usageThreshold value + */ + public Long usageThreshold() { + return this.usageThreshold; + } + + /** + * Set maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @param usageThreshold the usageThreshold value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withUsageThreshold(Long usageThreshold) { + this.usageThreshold = usageThreshold; + return this; + } + + /** + * Get set of export policy rules. + * + * @return the exportPolicy value + */ + public VolumePatchPropertiesExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set set of export policy rules. + * + * @param exportPolicy the exportPolicy value to set + * @return the VolumePatch object itself. + */ + public VolumePatch withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy) { + this.exportPolicy = exportPolicy; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatchPropertiesExportPolicy.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatchPropertiesExportPolicy.java new file mode 100644 index 0000000000000..bc4e1f8100382 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePatchPropertiesExportPolicy.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * exportPolicy. + * Set of export policy rules. + */ +public class VolumePatchPropertiesExportPolicy { + /** + * Export policy rule. + * Export policy rule. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get export policy rule. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set export policy rule. + * + * @param rules the rules value to set + * @return the VolumePatchPropertiesExportPolicy object itself. + */ + public VolumePatchPropertiesExportPolicy withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesDataProtection.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesDataProtection.java new file mode 100644 index 0000000000000..ffcbdf3b58ad2 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesDataProtection.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataProtection. + * DataProtection type volumes include an object containing details of the + * replication. + */ +public class VolumePropertiesDataProtection { + /** + * Replication. + * Replication properties. + */ + @JsonProperty(value = "replication") + private ReplicationObject replication; + + /** + * Snapshot. + * Snapshot properties. + */ + @JsonProperty(value = "snapshot") + private VolumeSnapshotProperties snapshot; + + /** + * Get replication properties. + * + * @return the replication value + */ + public ReplicationObject replication() { + return this.replication; + } + + /** + * Set replication properties. + * + * @param replication the replication value to set + * @return the VolumePropertiesDataProtection object itself. + */ + public VolumePropertiesDataProtection withReplication(ReplicationObject replication) { + this.replication = replication; + return this; + } + + /** + * Get snapshot properties. + * + * @return the snapshot value + */ + public VolumeSnapshotProperties snapshot() { + return this.snapshot; + } + + /** + * Set snapshot properties. + * + * @param snapshot the snapshot value to set + * @return the VolumePropertiesDataProtection object itself. + */ + public VolumePropertiesDataProtection withSnapshot(VolumeSnapshotProperties snapshot) { + this.snapshot = snapshot; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesExportPolicy.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesExportPolicy.java new file mode 100644 index 0000000000000..679a1f37e99a4 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumePropertiesExportPolicy.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * exportPolicy. + * Set of export policy rules. + */ +public class VolumePropertiesExportPolicy { + /** + * Export policy rule. + * Export policy rule. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get export policy rule. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set export policy rule. + * + * @param rules the rules value to set + * @return the VolumePropertiesExportPolicy object itself. + */ + public VolumePropertiesExportPolicy withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeRevert.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeRevert.java new file mode 100644 index 0000000000000..b4d4135d3cf9d --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeRevert.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * revert a volume to the snapshot. + */ +public class VolumeRevert { + /** + * Resource id of the snapshot. + */ + @JsonProperty(value = "snapshotId") + private String snapshotId; + + /** + * Get resource id of the snapshot. + * + * @return the snapshotId value + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set resource id of the snapshot. + * + * @param snapshotId the snapshotId value to set + * @return the VolumeRevert object itself. + */ + public VolumeRevert withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeSnapshotProperties.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeSnapshotProperties.java new file mode 100644 index 0000000000000..76dda463220d2 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/VolumeSnapshotProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Volume Snapshot Properties. + */ +public class VolumeSnapshotProperties { + /** + * Snapshot Policy ResourceId. + */ + @JsonProperty(value = "snapshotPolicyId") + private String snapshotPolicyId; + + /** + * Get snapshot Policy ResourceId. + * + * @return the snapshotPolicyId value + */ + public String snapshotPolicyId() { + return this.snapshotPolicyId; + } + + /** + * Set snapshot Policy ResourceId. + * + * @param snapshotPolicyId the snapshotPolicyId value to set + * @return the VolumeSnapshotProperties object itself. + */ + public VolumeSnapshotProperties withSnapshotPolicyId(String snapshotPolicyId) { + this.snapshotPolicyId = snapshotPolicyId; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volumes.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volumes.java new file mode 100644 index 0000000000000..912861235d8bc --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/Volumes.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.implementation.VolumesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Volumes. + */ +public interface Volumes extends SupportsCreating, HasInner { + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName, String poolName); + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName); + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsImpl.java new file mode 100644 index 0000000000000..79f64d76850f2 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsImpl.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.Accounts; +import com.microsoft.azure.management.netapp.v2020_03_01.NetAppAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class AccountsImpl extends GroupableResourcesCoreImpl implements Accounts { + protected AccountsImpl(NetAppManager manager) { + super(manager.inner().accounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + AccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + AccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + AccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public NetAppAccount call(NetAppAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public NetAppAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + protected NetAppAccountImpl wrapModel(NetAppAccountInner inner) { + return new NetAppAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected NetAppAccountImpl wrapModel(String name) { + return new NetAppAccountImpl(name, new NetAppAccountInner(), this.manager()); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsInner.java new file mode 100644 index 0000000000000..23e2afee450c4 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AccountsInner.java @@ -0,0 +1,805 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_03_01.NetAppAccountPatch; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Accounts. + */ +public class AccountsInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private AccountsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of AccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(AccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Accounts to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountPatch body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Accounts beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body NetAppAccountPatch body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetAppAccountInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Describe all NetApp Accounts in a resource group. + * List and describe all NetApp accounts in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<NetAppAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a NetApp Account. + * Get the NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner createOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().last().body(); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner beginCreateOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().single().body(); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a NetApp account. + * Create or update the specified NetApp account within the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a NetApp account. + * Delete the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner update(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().last().body(); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetAppAccountInner object if successful. + */ + public NetAppAccountInner beginUpdate(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).toBlocking().single().body(); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, body), serviceCallback); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, body).map(new Func1, NetAppAccountInner>() { + @Override + public NetAppAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a NetApp account. + * Patch the specified NetApp account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param body NetApp Account object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetAppAccountInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, NetAppAccountPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AzureNetAppFilesManagementClientImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AzureNetAppFilesManagementClientImpl.java new file mode 100644 index 0000000000000..e91d2d9d00fbb --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/AzureNetAppFilesManagementClientImpl.java @@ -0,0 +1,266 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AzureNetAppFilesManagementClientImpl class. + */ +public class AzureNetAppFilesManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AzureNetAppFilesManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Version of the API to be used with the client request. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AzureNetAppFilesManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AzureNetAppFilesManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AzureNetAppFilesManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The NetAppResourcesInner object to access its operations. + */ + private NetAppResourcesInner netAppResources; + + /** + * Gets the NetAppResourcesInner object to access its operations. + * @return the NetAppResourcesInner object. + */ + public NetAppResourcesInner netAppResources() { + return this.netAppResources; + } + + /** + * The AccountsInner object to access its operations. + */ + private AccountsInner accounts; + + /** + * Gets the AccountsInner object to access its operations. + * @return the AccountsInner object. + */ + public AccountsInner accounts() { + return this.accounts; + } + + /** + * The PoolsInner object to access its operations. + */ + private PoolsInner pools; + + /** + * Gets the PoolsInner object to access its operations. + * @return the PoolsInner object. + */ + public PoolsInner pools() { + return this.pools; + } + + /** + * The VolumesInner object to access its operations. + */ + private VolumesInner volumes; + + /** + * Gets the VolumesInner object to access its operations. + * @return the VolumesInner object. + */ + public VolumesInner volumes() { + return this.volumes; + } + + /** + * The SnapshotsInner object to access its operations. + */ + private SnapshotsInner snapshots; + + /** + * Gets the SnapshotsInner object to access its operations. + * @return the SnapshotsInner object. + */ + public SnapshotsInner snapshots() { + return this.snapshots; + } + + /** + * Initializes an instance of AzureNetAppFilesManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public AzureNetAppFilesManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AzureNetAppFilesManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AzureNetAppFilesManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AzureNetAppFilesManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AzureNetAppFilesManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-03-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.netAppResources = new NetAppResourcesInner(restClient().retrofit(), this); + this.accounts = new AccountsInner(restClient().retrofit(), this); + this.pools = new PoolsInner(restClient().retrofit(), this); + this.volumes = new VolumesInner(restClient().retrofit(), this); + this.snapshots = new SnapshotsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AzureNetAppFilesManagementClient", "2020-03-01"); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolImpl.java new file mode 100644 index 0000000000000..7bf8088764f39 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolImpl.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.CapacityPool; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.CapacityPoolPatch; +import com.microsoft.azure.management.netapp.v2020_03_01.ServiceLevel; +import java.util.Map; +import com.microsoft.azure.management.netapp.v2020_03_01.PatchServiceLevel; +import rx.functions.Func1; + +class CapacityPoolImpl extends CreatableUpdatableImpl implements CapacityPool, CapacityPool.Definition, CapacityPool.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private CapacityPoolPatch updateParameter; + + CapacityPoolImpl(String name, NetAppManager manager) { + super(name, new CapacityPoolInner()); + this.manager = manager; + // Set resource name + this.poolName = name; + // + this.updateParameter = new CapacityPoolPatch(); + } + + CapacityPoolImpl(CapacityPoolInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.poolName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "capacityPools"); + // + this.updateParameter = new CapacityPoolPatch(); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.poolName, this.inner()) + .map(new Func1() { + @Override + public CapacityPoolInner call(CapacityPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.updateParameter) + .map(new Func1() { + @Override + public CapacityPoolInner call(CapacityPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new CapacityPoolPatch(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String poolId() { + return this.inner().poolId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ServiceLevel serviceLevel() { + return this.inner().serviceLevel(); + } + + @Override + public long size() { + return this.inner().size(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CapacityPoolImpl withExistingNetAppAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public CapacityPoolImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public CapacityPoolImpl withServiceLevel(ServiceLevel serviceLevel) { + this.inner().withServiceLevel(serviceLevel); + return this; + } + + @Override + public CapacityPoolImpl withSize(long size) { + this.inner().withSize(size); + return this; + } + + @Override + public CapacityPoolImpl withServiceLevel(PatchServiceLevel serviceLevel) { + this.updateParameter.withServiceLevel(serviceLevel); + return this; + } + + @Override + public CapacityPoolImpl withSize(Long size) { + this.updateParameter.withSize(size); + return this; + } + + @Override + public CapacityPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolInner.java new file mode 100644 index 0000000000000..23e6ff4d3fada --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/CapacityPoolInner.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.ServiceLevel; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Capacity pool resource. + */ +@JsonFlatten +public class CapacityPoolInner extends Resource { + /** + * poolId. + * UUID v4 used to identify the Pool. + */ + @JsonProperty(value = "properties.poolId", access = JsonProperty.Access.WRITE_ONLY) + private String poolId; + + /** + * size. + * Provisioned size of the pool (in bytes). Allowed values are in 4TiB + * chunks (value must be multiply of 4398046511104). + */ + @JsonProperty(value = "properties.size", required = true) + private long size; + + /** + * serviceLevel. + * The service level of the file system. Possible values include: + * 'Standard', 'Premium', 'Ultra'. + */ + @JsonProperty(value = "properties.serviceLevel", required = true) + private ServiceLevel serviceLevel; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get uUID v4 used to identify the Pool. + * + * @return the poolId value + */ + public String poolId() { + return this.poolId; + } + + /** + * Get provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @return the size value + */ + public long size() { + return this.size; + } + + /** + * Set provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + * + * @param size the size value to set + * @return the CapacityPoolInner object itself. + */ + public CapacityPoolInner withSize(long size) { + this.size = size; + return this; + } + + /** + * Get the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @return the serviceLevel value + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @param serviceLevel the serviceLevel value to set + * @return the CapacityPoolInner object itself. + */ + public CapacityPoolInner withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/IdParsingUtils.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..268c921f01024 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountImpl.java new file mode 100644 index 0000000000000..253c6e5a11978 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountImpl.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.NetAppAccount; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.NetAppAccountPatch; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.ActiveDirectory; +import rx.functions.Func1; + +class NetAppAccountImpl extends GroupableResourceCoreImpl implements NetAppAccount, NetAppAccount.Definition, NetAppAccount.Update { + private NetAppAccountPatch updateParameter; + NetAppAccountImpl(String name, NetAppAccountInner inner, NetAppManager manager) { + super(name, inner, manager); + this.updateParameter = new NetAppAccountPatch(); + } + + @Override + public Observable createResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public NetAppAccountInner call(NetAppAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public NetAppAccountInner call(NetAppAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountsInner client = this.manager().inner().accounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new NetAppAccountPatch(); + } + + @Override + public List activeDirectories() { + return this.inner().activeDirectories(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public NetAppAccountImpl withActiveDirectories(List activeDirectories) { + if (isInCreateMode()) { + this.inner().withActiveDirectories(activeDirectories); + } else { + this.updateParameter.withActiveDirectories(activeDirectories); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountInner.java new file mode 100644 index 0000000000000..767af03ea3379 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppAccountInner.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.ActiveDirectory; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * NetApp account resource. + */ +@JsonFlatten +public class NetAppAccountInner extends Resource { + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Active Directories. + */ + @JsonProperty(value = "properties.activeDirectories") + private List activeDirectories; + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get active Directories. + * + * @return the activeDirectories value + */ + public List activeDirectories() { + return this.activeDirectories; + } + + /** + * Set active Directories. + * + * @param activeDirectories the activeDirectories value to set + * @return the NetAppAccountInner object itself. + */ + public NetAppAccountInner withActiveDirectories(List activeDirectories) { + this.activeDirectories = activeDirectories; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppManager.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppManager.java new file mode 100644 index 0000000000000..9b4399c3faae4 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppManager.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.netapp.v2020_03_01.Operations; +import com.microsoft.azure.management.netapp.v2020_03_01.NetAppResources; +import com.microsoft.azure.management.netapp.v2020_03_01.Accounts; +import com.microsoft.azure.management.netapp.v2020_03_01.Pools; +import com.microsoft.azure.management.netapp.v2020_03_01.Volumes; +import com.microsoft.azure.management.netapp.v2020_03_01.Snapshots; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure NetApp resource management. + */ +public final class NetAppManager extends ManagerCore { + private Operations operations; + private NetAppResources netAppResources; + private Accounts accounts; + private Pools pools; + private Volumes volumes; + private Snapshots snapshots; + /** + * Get a Configurable instance that can be used to create NetAppManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new NetAppManager.ConfigurableImpl(); + } + /** + * Creates an instance of NetAppManager that exposes NetApp resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the NetAppManager + */ + public static NetAppManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new NetAppManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of NetAppManager that exposes NetApp resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the NetAppManager + */ + public static NetAppManager authenticate(RestClient restClient, String subscriptionId) { + return new NetAppManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of NetAppManager that exposes NetApp management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing NetApp management API entry points that work across subscriptions + */ + NetAppManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage NetAppResources. + */ + public NetAppResources netAppResources() { + if (this.netAppResources == null) { + this.netAppResources = new NetAppResourcesImpl(this); + } + return this.netAppResources; + } + + /** + * @return Entry point to manage Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(this); + } + return this.accounts; + } + + /** + * @return Entry point to manage Pools. + */ + public Pools pools() { + if (this.pools == null) { + this.pools = new PoolsImpl(this); + } + return this.pools; + } + + /** + * @return Entry point to manage Volumes. + */ + public Volumes volumes() { + if (this.volumes == null) { + this.volumes = new VolumesImpl(this); + } + return this.volumes; + } + + /** + * @return Entry point to manage Snapshots. + */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(this); + } + return this.snapshots; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public NetAppManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return NetAppManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private NetAppManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AzureNetAppFilesManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesImpl.java new file mode 100644 index 0000000000000..618a3515f844a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.NetAppResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.ResourceNameAvailability; +import com.microsoft.azure.management.netapp.v2020_03_01.CheckNameResourceTypes; + +class NetAppResourcesImpl extends WrapperImpl implements NetAppResources { + private final NetAppManager manager; + + NetAppResourcesImpl(NetAppManager manager) { + super(manager.inner().netAppResources()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + NetAppResourcesInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, name, type, resourceGroup) + .map(new Func1() { + @Override + public ResourceNameAvailability call(ResourceNameAvailabilityInner inner) { + return new ResourceNameAvailabilityImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + NetAppResourcesInner client = this.inner(); + return client.checkFilePathAvailabilityAsync(location, name, type, resourceGroup) + .map(new Func1() { + @Override + public ResourceNameAvailability call(ResourceNameAvailabilityInner inner) { + return new ResourceNameAvailabilityImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesInner.java new file mode 100644 index 0000000000000..7a495b4e456c3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/NetAppResourcesInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_03_01.CheckNameResourceTypes; +import com.microsoft.azure.management.netapp.v2020_03_01.ResourceNameAvailabilityRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NetAppResources. + */ +public class NetAppResourcesInner { + /** The Retrofit service to perform REST calls. */ + private NetAppResourcesService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of NetAppResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetAppResourcesInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(NetAppResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NetAppResources to be + * used by Retrofit to perform actually REST calls. + */ + interface NetAppResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.NetAppResources checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceNameAvailabilityRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.NetAppResources checkFilePathAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability") + Observable> checkFilePathAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ResourceNameAvailabilityRequest body, @Header("User-Agent") String userAgent); + + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceNameAvailabilityInner object if successful. + */ + public ResourceNameAvailabilityInner checkNameAvailability(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkNameAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).toBlocking().single().body(); + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup), serviceCallback); + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceNameAvailabilityInner object + */ + public Observable checkNameAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkNameAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).map(new Func1, ResourceNameAvailabilityInner>() { + @Override + public ResourceNameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check resource name availability. + * Check if a resource name is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceNameAvailabilityInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + ResourceNameAvailabilityRequest body = new ResourceNameAvailabilityRequest(); + body.withName(name); + body.withType(type); + body.withResourceGroup(resourceGroup); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceNameAvailabilityInner object if successful. + */ + public ResourceNameAvailabilityInner checkFilePathAvailability(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkFilePathAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).toBlocking().single().body(); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkFilePathAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup), serviceCallback); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceNameAvailabilityInner object + */ + public Observable checkFilePathAvailabilityAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + return checkFilePathAvailabilityWithServiceResponseAsync(location, name, type, resourceGroup).map(new Func1, ResourceNameAvailabilityInner>() { + @Override + public ResourceNameAvailabilityInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check file path availability. + * Check if a file path is available. + * + * @param location The location + * @param name Resource name to verify. + * @param type Resource type used for verification. Possible values include: 'Microsoft.NetApp/netAppAccounts', 'Microsoft.NetApp/netAppAccounts/capacityPools', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes', 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots' + * @param resourceGroup Resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceNameAvailabilityInner object + */ + public Observable> checkFilePathAvailabilityWithServiceResponseAsync(String location, String name, CheckNameResourceTypes type, String resourceGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (type == null) { + throw new IllegalArgumentException("Parameter type is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + ResourceNameAvailabilityRequest body = new ResourceNameAvailabilityRequest(); + body.withName(name); + body.withType(type); + body.withResourceGroup(resourceGroup); + return service.checkFilePathAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkFilePathAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkFilePathAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..1af10f71853d1 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.OperationDisplay; +import com.microsoft.azure.management.netapp.v2020_03_01.ServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final NetAppManager manager; + OperationImpl(OperationInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public ServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..c6e463872c916 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.OperationDisplay; +import com.microsoft.azure.management.netapp.v2020_03_01.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Microsoft.NetApp REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin of operations. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin of operations. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get one property of operation, include metric specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set one property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..b56ad56bb9569 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final NetAppManager manager; + + OperationsImpl(NetAppManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..2d6d51a034767 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/OperationsInner.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Operations list" }) + @GET("providers/Microsoft.NetApp/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describes the Resource Provider. + * Lists all of the available Microsoft.NetApp Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PageImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..9b7e49aebc6da --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsImpl.java new file mode 100644 index 0000000000000..1ede65bb5306a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.Pools; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.CapacityPool; + +class PoolsImpl extends WrapperImpl implements Pools { + private final NetAppManager manager; + + PoolsImpl(NetAppManager manager) { + super(manager.inner().pools()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public CapacityPoolImpl define(String name) { + return wrapModel(name); + } + + private CapacityPoolImpl wrapModel(CapacityPoolInner inner) { + return new CapacityPoolImpl(inner, manager()); + } + + private CapacityPoolImpl wrapModel(String name) { + return new CapacityPoolImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + PoolsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CapacityPool call(CapacityPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName) + .flatMap(new Func1>() { + @Override + public Observable call(CapacityPoolInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CapacityPool)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName).toCompletable(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsInner.java new file mode 100644 index 0000000000000..8c3a26f26f43a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/PoolsInner.java @@ -0,0 +1,852 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_03_01.CapacityPoolPatch; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Pools. + */ +public class PoolsInner { + /** The Retrofit service to perform REST calls. */ + private PoolsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of PoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PoolsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(PoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Pools to be + * used by Retrofit to perform actually REST calls. + */ + interface PoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolPatch body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Body CapacityPoolPatch body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Pools beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<CapacityPoolInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CapacityPoolInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describe all Capacity Pools. + * List all capacity pools in the NetApp Account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CapacityPoolInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner get(String resourceGroupName, String accountName, String poolName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a Capacity Pool. + * Get details of the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner createOrUpdate(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().last().body(); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner beginCreateOrUpdate(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().single().body(); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update the specified capacity pool within the resource group. + * Create or Update a capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner update(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().last().body(); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapacityPoolInner object if successful. + */ + public CapacityPoolInner beginUpdate(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).toBlocking().single().body(); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body), serviceCallback); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, body).map(new Func1, CapacityPoolInner>() { + @Override + public CapacityPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a capacity pool. + * Patch the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param body Capacity pool object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapacityPoolInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, CapacityPoolPatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String poolName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().last().body(); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String poolName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a capacity pool. + * Delete the specified capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusImpl.java new file mode 100644 index 0000000000000..ee801917e2550 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.ReplicationStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.MirrorState; +import com.microsoft.azure.management.netapp.v2020_03_01.RelationshipStatus; + +class ReplicationStatusImpl extends WrapperImpl implements ReplicationStatus { + private final NetAppManager manager; + ReplicationStatusImpl(ReplicationStatusInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public String errorMessage() { + return this.inner().errorMessage(); + } + + @Override + public Boolean healthy() { + return this.inner().healthy(); + } + + @Override + public MirrorState mirrorState() { + return this.inner().mirrorState(); + } + + @Override + public RelationshipStatus relationshipStatus() { + return this.inner().relationshipStatus(); + } + + @Override + public String totalProgress() { + return this.inner().totalProgress(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusInner.java new file mode 100644 index 0000000000000..305af729ddbe0 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ReplicationStatusInner.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.RelationshipStatus; +import com.microsoft.azure.management.netapp.v2020_03_01.MirrorState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Replication status. + */ +public class ReplicationStatusInner { + /** + * Replication health check. + */ + @JsonProperty(value = "healthy") + private Boolean healthy; + + /** + * Status of the mirror relationship. Possible values include: 'Idle', + * 'Transferring'. + */ + @JsonProperty(value = "relationshipStatus") + private RelationshipStatus relationshipStatus; + + /** + * The status of the replication. Possible values include: 'Uninitialized', + * 'Mirrored', 'Broken'. + */ + @JsonProperty(value = "mirrorState") + private MirrorState mirrorState; + + /** + * The progress of the replication. + */ + @JsonProperty(value = "totalProgress") + private String totalProgress; + + /** + * Displays error message if the replication is in an error state. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get replication health check. + * + * @return the healthy value + */ + public Boolean healthy() { + return this.healthy; + } + + /** + * Set replication health check. + * + * @param healthy the healthy value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withHealthy(Boolean healthy) { + this.healthy = healthy; + return this; + } + + /** + * Get status of the mirror relationship. Possible values include: 'Idle', 'Transferring'. + * + * @return the relationshipStatus value + */ + public RelationshipStatus relationshipStatus() { + return this.relationshipStatus; + } + + /** + * Set status of the mirror relationship. Possible values include: 'Idle', 'Transferring'. + * + * @param relationshipStatus the relationshipStatus value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withRelationshipStatus(RelationshipStatus relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get the status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'. + * + * @return the mirrorState value + */ + public MirrorState mirrorState() { + return this.mirrorState; + } + + /** + * Set the status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'. + * + * @param mirrorState the mirrorState value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withMirrorState(MirrorState mirrorState) { + this.mirrorState = mirrorState; + return this; + } + + /** + * Get the progress of the replication. + * + * @return the totalProgress value + */ + public String totalProgress() { + return this.totalProgress; + } + + /** + * Set the progress of the replication. + * + * @param totalProgress the totalProgress value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withTotalProgress(String totalProgress) { + this.totalProgress = totalProgress; + return this; + } + + /** + * Get displays error message if the replication is in an error state. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set displays error message if the replication is in an error state. + * + * @param errorMessage the errorMessage value to set + * @return the ReplicationStatusInner object itself. + */ + public ReplicationStatusInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityImpl.java new file mode 100644 index 0000000000000..018a355b116e3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.ResourceNameAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.InAvailabilityReasonType; + +class ResourceNameAvailabilityImpl extends WrapperImpl implements ResourceNameAvailability { + private final NetAppManager manager; + ResourceNameAvailabilityImpl(ResourceNameAvailabilityInner inner, NetAppManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Boolean isAvailable() { + return this.inner().isAvailable(); + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public InAvailabilityReasonType reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityInner.java new file mode 100644 index 0000000000000..3f42dc63e5649 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/ResourceNameAvailabilityInner.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.InAvailabilityReasonType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information regarding availability of a resource name. + */ +public class ResourceNameAvailabilityInner { + /** + * <code>true</code> indicates name is valid and available. + * <code>false</code> indicates the name is invalid, + * unavailable, or both. + */ + @JsonProperty(value = "isAvailable") + private Boolean isAvailable; + + /** + * <code>Invalid</code> indicates the name provided does not + * match Azure App Service naming requirements. + * <code>AlreadyExists</code> indicates that the name is + * already in use and is therefore unavailable. Possible values include: + * 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason") + private InAvailabilityReasonType reason; + + /** + * If reason == invalid, provide the user with the reason why the given + * name is invalid, and provide the resource naming requirements so that + * the user can select a valid name. If reason == AlreadyExists, explain + * that resource name is already in use, and direct them to select a + * different name. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. + * + * @return the isAvailable value + */ + public Boolean isAvailable() { + return this.isAvailable; + } + + /** + * Set <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. + * + * @param isAvailable the isAvailable value to set + * @return the ResourceNameAvailabilityInner object itself. + */ + public ResourceNameAvailabilityInner withIsAvailable(Boolean isAvailable) { + this.isAvailable = isAvailable; + return this; + } + + /** + * Get <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public InAvailabilityReasonType reason() { + return this.reason; + } + + /** + * Set <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @param reason the reason value to set + * @return the ResourceNameAvailabilityInner object itself. + */ + public ResourceNameAvailabilityInner withReason(InAvailabilityReasonType reason) { + this.reason = reason; + return this; + } + + /** + * Get if reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + * + * @param message the message value to set + * @return the ResourceNameAvailabilityInner object itself. + */ + public ResourceNameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotImpl.java new file mode 100644 index 0000000000000..f066360550d47 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.Snapshot; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class SnapshotImpl extends CreatableUpdatableImpl implements Snapshot, Snapshot.Definition, Snapshot.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private String volumeName; + private String snapshotName; + private String clocation; + private Object ubody; + + SnapshotImpl(String name, NetAppManager manager) { + super(name, new SnapshotInner()); + this.manager = manager; + // Set resource name + this.snapshotName = name; + // + } + + SnapshotImpl(SnapshotInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.snapshotName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "capacityPools"); + this.volumeName = IdParsingUtils.getValueFromIdByName(inner.id(), "volumes"); + this.snapshotName = IdParsingUtils.getValueFromIdByName(inner.id(), "snapshots"); + // + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SnapshotsInner client = this.manager().inner().snapshots(); + return client.createAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.snapshotName, this.clocation) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SnapshotsInner client = this.manager().inner().snapshots(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.snapshotName, this.ubody) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SnapshotsInner client = this.manager().inner().snapshots(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.snapshotName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String snapshotId() { + return this.inner().snapshotId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SnapshotImpl withExistingVolume(String resourceGroupName, String accountName, String poolName, String volumeName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.poolName = poolName; + this.volumeName = volumeName; + return this; + } + + @Override + public SnapshotImpl withLocation(String location) { + this.clocation = location; + return this; + } + + @Override + public SnapshotImpl withBody(Object body) { + this.ubody = body; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotInner.java new file mode 100644 index 0000000000000..c8bd4101ac432 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotInner.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Snapshot of a Volume. + */ +@JsonFlatten +public class SnapshotInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * snapshotId. + * UUID v4 used to identify the Snapshot. + */ + @JsonProperty(value = "properties.snapshotId", access = JsonProperty.Access.WRITE_ONLY) + private String snapshotId; + + /** + * name. + * The creation date of the snapshot. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the SnapshotInner object itself. + */ + public SnapshotInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get uUID v4 used to identify the Snapshot. + * + * @return the snapshotId value + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Get the creation date of the snapshot. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsImpl.java new file mode 100644 index 0000000000000..9d2b9a35634f5 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.Snapshots; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.Snapshot; + +class SnapshotsImpl extends WrapperImpl implements Snapshots { + private final NetAppManager manager; + + SnapshotsImpl(NetAppManager manager) { + super(manager.inner().snapshots()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public SnapshotImpl define(String name) { + return wrapModel(name); + } + + private SnapshotImpl wrapModel(SnapshotInner inner) { + return new SnapshotImpl(inner, manager()); + } + + private SnapshotImpl wrapModel(String name) { + return new SnapshotImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + SnapshotsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, poolName, volumeName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Snapshot call(SnapshotInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + SnapshotsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName) + .flatMap(new Func1>() { + @Override + public Observable call(SnapshotInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Snapshot)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + SnapshotsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toCompletable(); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsInner.java new file mode 100644 index 0000000000000..017b245659458 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/SnapshotsInner.java @@ -0,0 +1,962 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Snapshots. + */ +public class SnapshotsInner { + /** The Retrofit service to perform REST calls. */ + private SnapshotsService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of SnapshotsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SnapshotsInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(SnapshotsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Snapshots to be + * used by Retrofit to perform actually REST calls. + */ + interface SnapshotsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SnapshotInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SnapshotInner body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Body Object body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Body Object body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Snapshots beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Path("snapshotName") String snapshotName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<SnapshotInner> object if successful. + */ + public List list(String resourceGroupName, String accountName, String poolName, String volumeName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SnapshotInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describe all snapshots. + * List all snapshots associated with the volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SnapshotInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotInner object if successful. + */ + public SnapshotInner get(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toBlocking().single().body(); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName), serviceCallback); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a snapshot. + * Get details of the specified snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotInner object if successful. + */ + public SnapshotInner create(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).toBlocking().last().body(); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location), serviceCallback); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + SnapshotInner body = new SnapshotInner(); + body.withLocation(location); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotInner object if successful. + */ + public SnapshotInner beginCreate(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).toBlocking().single().body(); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location), serviceCallback); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, location).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a snapshot. + * Create the specified snapshot within the given volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param location Resource location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + SnapshotInner body = new SnapshotInner(); + body.withLocation(location); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotInner object if successful. + */ + public SnapshotInner update(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).toBlocking().last().body(); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body), serviceCallback); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SnapshotInner object if successful. + */ + public SnapshotInner beginUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).toBlocking().single().body(); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body), serviceCallback); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, body).map(new Func1, SnapshotInner>() { + @Override + public SnapshotInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a snapshot. + * Patch a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param body Snapshot object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SnapshotInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, Object body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toBlocking().last().body(); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName), serviceCallback); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).toBlocking().single().body(); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName), serviceCallback); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a snapshot. + * Delete snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotName The name of the mount target + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (snapshotName == null) { + throw new IllegalArgumentException("Parameter snapshotName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, snapshotName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeImpl.java new file mode 100644 index 0000000000000..4123bb8a5ca04 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeImpl.java @@ -0,0 +1,315 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.Volume; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumePatch; +import com.microsoft.azure.management.netapp.v2020_03_01.ServiceLevel; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumePropertiesExportPolicy; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.MountTargetProperties; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumePropertiesDataProtection; +import java.util.Map; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumePatchPropertiesExportPolicy; +import rx.functions.Func1; + +class VolumeImpl extends CreatableUpdatableImpl implements Volume, Volume.Definition, Volume.Update { + private final NetAppManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private String volumeName; + private VolumePatch updateParameter; + + VolumeImpl(String name, NetAppManager manager) { + super(name, new VolumeInner()); + this.manager = manager; + // Set resource name + this.volumeName = name; + // + this.updateParameter = new VolumePatch(); + } + + VolumeImpl(VolumeInner inner, NetAppManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.volumeName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "netAppAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "capacityPools"); + this.volumeName = IdParsingUtils.getValueFromIdByName(inner.id(), "volumes"); + // + this.updateParameter = new VolumePatch(); + } + + @Override + public NetAppManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VolumesInner client = this.manager().inner().volumes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.inner()) + .map(new Func1() { + @Override + public VolumeInner call(VolumeInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VolumesInner client = this.manager().inner().volumes(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName, this.updateParameter) + .map(new Func1() { + @Override + public VolumeInner call(VolumeInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VolumesInner client = this.manager().inner().volumes(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName, this.volumeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new VolumePatch(); + } + + @Override + public String baremetalTenantId() { + return this.inner().baremetalTenantId(); + } + + @Override + public String creationToken() { + return this.inner().creationToken(); + } + + @Override + public VolumePropertiesDataProtection dataProtection() { + return this.inner().dataProtection(); + } + + @Override + public VolumePropertiesExportPolicy exportPolicy() { + return this.inner().exportPolicy(); + } + + @Override + public String fileSystemId() { + return this.inner().fileSystemId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isRestoring() { + return this.inner().isRestoring(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public List mountTargets() { + return this.inner().mountTargets(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List protocolTypes() { + return this.inner().protocolTypes(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ServiceLevel serviceLevel() { + return this.inner().serviceLevel(); + } + + @Override + public Boolean snapshotDirectoryVisible() { + return this.inner().snapshotDirectoryVisible(); + } + + @Override + public String snapshotId() { + return this.inner().snapshotId(); + } + + @Override + public String subnetId() { + return this.inner().subnetId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public long usageThreshold() { + return this.inner().usageThreshold(); + } + + @Override + public String volumeType() { + return this.inner().volumeType(); + } + + @Override + public VolumeImpl withExistingCapacityPool(String resourceGroupName, String accountName, String poolName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.poolName = poolName; + return this; + } + + @Override + public VolumeImpl withCreationToken(String creationToken) { + this.inner().withCreationToken(creationToken); + return this; + } + + @Override + public VolumeImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VolumeImpl withSubnetId(String subnetId) { + this.inner().withSubnetId(subnetId); + return this; + } + + @Override + public VolumeImpl withUsageThreshold(long usageThreshold) { + this.inner().withUsageThreshold(usageThreshold); + return this; + } + + @Override + public VolumeImpl withDataProtection(VolumePropertiesDataProtection dataProtection) { + this.inner().withDataProtection(dataProtection); + return this; + } + + @Override + public VolumeImpl withExportPolicy(VolumePropertiesExportPolicy exportPolicy) { + this.inner().withExportPolicy(exportPolicy); + return this; + } + + @Override + public VolumeImpl withIsRestoring(Boolean isRestoring) { + this.inner().withIsRestoring(isRestoring); + return this; + } + + @Override + public VolumeImpl withMountTargets(List mountTargets) { + this.inner().withMountTargets(mountTargets); + return this; + } + + @Override + public VolumeImpl withProtocolTypes(List protocolTypes) { + this.inner().withProtocolTypes(protocolTypes); + return this; + } + + @Override + public VolumeImpl withSnapshotDirectoryVisible(Boolean snapshotDirectoryVisible) { + this.inner().withSnapshotDirectoryVisible(snapshotDirectoryVisible); + return this; + } + + @Override + public VolumeImpl withSnapshotId(String snapshotId) { + this.inner().withSnapshotId(snapshotId); + return this; + } + + @Override + public VolumeImpl withVolumeType(String volumeType) { + this.inner().withVolumeType(volumeType); + return this; + } + + @Override + public VolumeImpl withExportPolicy(VolumePatchPropertiesExportPolicy exportPolicy) { + this.updateParameter.withExportPolicy(exportPolicy); + return this; + } + + @Override + public VolumeImpl withUsageThreshold(Long usageThreshold) { + this.updateParameter.withUsageThreshold(usageThreshold); + return this; + } + + @Override + public VolumeImpl withServiceLevel(ServiceLevel serviceLevel) { + if (isInCreateMode()) { + this.inner().withServiceLevel(serviceLevel); + } else { + this.updateParameter.withServiceLevel(serviceLevel); + } + return this; + } + + @Override + public VolumeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeInner.java new file mode 100644 index 0000000000000..f4c6836ba1263 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumeInner.java @@ -0,0 +1,399 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.management.netapp.v2020_03_01.ServiceLevel; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumePropertiesExportPolicy; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.MountTargetProperties; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumePropertiesDataProtection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Volume resource. + */ +@JsonFlatten +public class VolumeInner extends Resource { + /** + * FileSystem ID. + * Unique FileSystem Identifier. + */ + @JsonProperty(value = "properties.fileSystemId", access = JsonProperty.Access.WRITE_ONLY) + private String fileSystemId; + + /** + * Creation Token or File Path. + * A unique file path for the volume. Used when creating mount targets. + */ + @JsonProperty(value = "properties.creationToken", required = true) + private String creationToken; + + /** + * serviceLevel. + * The service level of the file system. Possible values include: + * 'Standard', 'Premium', 'Ultra'. + */ + @JsonProperty(value = "properties.serviceLevel") + private ServiceLevel serviceLevel; + + /** + * usageThreshold. + * Maximum storage quota allowed for a file system in bytes. This is a soft + * quota used for alerting only. Minimum size is 100 GiB. Upper limit is + * 100TiB. Specified in bytes. + */ + @JsonProperty(value = "properties.usageThreshold", required = true) + private long usageThreshold; + + /** + * exportPolicy. + * Set of export policy rules. + */ + @JsonProperty(value = "properties.exportPolicy") + private VolumePropertiesExportPolicy exportPolicy; + + /** + * protocolTypes. + * Set of protocol types. + */ + @JsonProperty(value = "properties.protocolTypes") + private List protocolTypes; + + /** + * Azure lifecycle management. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Snapshot ID. + * UUID v4 or resource identifier used to identify the Snapshot. + */ + @JsonProperty(value = "properties.snapshotId") + private String snapshotId; + + /** + * Baremetal Tenant ID. + * Unique Baremetal Tenant Identifier. + */ + @JsonProperty(value = "properties.baremetalTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String baremetalTenantId; + + /** + * The Azure Resource URI for a delegated subnet. Must have the delegation + * Microsoft.NetApp/volumes. + */ + @JsonProperty(value = "properties.subnetId", required = true) + private String subnetId; + + /** + * mountTargets. + * List of mount targets. + */ + @JsonProperty(value = "properties.mountTargets") + private List mountTargets; + + /** + * What type of volume is this. + */ + @JsonProperty(value = "properties.volumeType") + private String volumeType; + + /** + * DataProtection. + * DataProtection type volumes include an object containing details of the + * replication. + */ + @JsonProperty(value = "properties.dataProtection") + private VolumePropertiesDataProtection dataProtection; + + /** + * Restoring. + */ + @JsonProperty(value = "properties.isRestoring") + private Boolean isRestoring; + + /** + * If enabled (true) the volume will contain a read-only .snapshot + * directory which provides access to each of the volume's snapshots + * (default to true). + */ + @JsonProperty(value = "properties.snapshotDirectoryVisible") + private Boolean snapshotDirectoryVisible; + + /** + * Get unique FileSystem Identifier. + * + * @return the fileSystemId value + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Get a unique file path for the volume. Used when creating mount targets. + * + * @return the creationToken value + */ + public String creationToken() { + return this.creationToken; + } + + /** + * Set a unique file path for the volume. Used when creating mount targets. + * + * @param creationToken the creationToken value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withCreationToken(String creationToken) { + this.creationToken = creationToken; + return this; + } + + /** + * Get the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @return the serviceLevel value + */ + public ServiceLevel serviceLevel() { + return this.serviceLevel; + } + + /** + * Set the service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra'. + * + * @param serviceLevel the serviceLevel value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withServiceLevel(ServiceLevel serviceLevel) { + this.serviceLevel = serviceLevel; + return this; + } + + /** + * Get maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @return the usageThreshold value + */ + public long usageThreshold() { + return this.usageThreshold; + } + + /** + * Set maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + * + * @param usageThreshold the usageThreshold value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withUsageThreshold(long usageThreshold) { + this.usageThreshold = usageThreshold; + return this; + } + + /** + * Get set of export policy rules. + * + * @return the exportPolicy value + */ + public VolumePropertiesExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set set of export policy rules. + * + * @param exportPolicy the exportPolicy value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withExportPolicy(VolumePropertiesExportPolicy exportPolicy) { + this.exportPolicy = exportPolicy; + return this; + } + + /** + * Get set of protocol types. + * + * @return the protocolTypes value + */ + public List protocolTypes() { + return this.protocolTypes; + } + + /** + * Set set of protocol types. + * + * @param protocolTypes the protocolTypes value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withProtocolTypes(List protocolTypes) { + this.protocolTypes = protocolTypes; + return this; + } + + /** + * Get azure lifecycle management. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get uUID v4 or resource identifier used to identify the Snapshot. + * + * @return the snapshotId value + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set uUID v4 or resource identifier used to identify the Snapshot. + * + * @param snapshotId the snapshotId value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + + /** + * Get unique Baremetal Tenant Identifier. + * + * @return the baremetalTenantId value + */ + public String baremetalTenantId() { + return this.baremetalTenantId; + } + + /** + * Get the Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. + * + * @param subnetId the subnetId value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get list of mount targets. + * + * @return the mountTargets value + */ + public List mountTargets() { + return this.mountTargets; + } + + /** + * Set list of mount targets. + * + * @param mountTargets the mountTargets value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withMountTargets(List mountTargets) { + this.mountTargets = mountTargets; + return this; + } + + /** + * Get what type of volume is this. + * + * @return the volumeType value + */ + public String volumeType() { + return this.volumeType; + } + + /** + * Set what type of volume is this. + * + * @param volumeType the volumeType value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withVolumeType(String volumeType) { + this.volumeType = volumeType; + return this; + } + + /** + * Get dataProtection type volumes include an object containing details of the replication. + * + * @return the dataProtection value + */ + public VolumePropertiesDataProtection dataProtection() { + return this.dataProtection; + } + + /** + * Set dataProtection type volumes include an object containing details of the replication. + * + * @param dataProtection the dataProtection value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withDataProtection(VolumePropertiesDataProtection dataProtection) { + this.dataProtection = dataProtection; + return this; + } + + /** + * Get restoring. + * + * @return the isRestoring value + */ + public Boolean isRestoring() { + return this.isRestoring; + } + + /** + * Set restoring. + * + * @param isRestoring the isRestoring value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withIsRestoring(Boolean isRestoring) { + this.isRestoring = isRestoring; + return this; + } + + /** + * Get if enabled (true) the volume will contain a read-only .snapshot directory which provides access to each of the volume's snapshots (default to true). + * + * @return the snapshotDirectoryVisible value + */ + public Boolean snapshotDirectoryVisible() { + return this.snapshotDirectoryVisible; + } + + /** + * Set if enabled (true) the volume will contain a read-only .snapshot directory which provides access to each of the volume's snapshots (default to true). + * + * @param snapshotDirectoryVisible the snapshotDirectoryVisible value to set + * @return the VolumeInner object itself. + */ + public VolumeInner withSnapshotDirectoryVisible(Boolean snapshotDirectoryVisible) { + this.snapshotDirectoryVisible = snapshotDirectoryVisible; + return this; + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesImpl.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesImpl.java new file mode 100644 index 0000000000000..af745781943b1 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.netapp.v2020_03_01.Volumes; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.netapp.v2020_03_01.Volume; +import com.microsoft.azure.management.netapp.v2020_03_01.ReplicationStatus; + +class VolumesImpl extends WrapperImpl implements Volumes { + private final NetAppManager manager; + + VolumesImpl(NetAppManager manager) { + super(manager.inner().volumes()); + this.manager = manager; + } + + public NetAppManager manager() { + return this.manager; + } + + @Override + public VolumeImpl define(String name) { + return wrapModel(name); + } + + private VolumeImpl wrapModel(VolumeInner inner) { + return new VolumeImpl(inner, manager()); + } + + private VolumeImpl wrapModel(String name) { + return new VolumeImpl(name, this.manager()); + } + + @Override + public Completable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.revertAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.breakReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.resyncReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.deleteReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Completable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.authorizeReplicationAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName, String poolName) { + VolumesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, poolName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Volume call(VolumeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName, volumeName) + .flatMap(new Func1>() { + @Override + public Observable call(VolumeInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Volume)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName, volumeName).toCompletable(); + } + + @Override + public Observable replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + VolumesInner client = this.inner(); + return client.replicationStatusMethodAsync(resourceGroupName, accountName, poolName, volumeName) + .map(new Func1() { + @Override + public ReplicationStatus call(ReplicationStatusInner inner) { + return new ReplicationStatusImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesInner.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesInner.java new file mode 100644 index 0000000000000..ad09d7e6038b3 --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/VolumesInner.java @@ -0,0 +1,2407 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.netapp.v2020_03_01.AuthorizeRequest; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumePatch; +import com.microsoft.azure.management.netapp.v2020_03_01.VolumeRevert; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Volumes. + */ +public class VolumesInner { + /** The Retrofit service to perform REST calls. */ + private VolumesService service; + /** The service client containing this operation class. */ + private AzureNetAppFilesManagementClientImpl client; + + /** + * Initializes an instance of VolumesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VolumesInner(Retrofit retrofit, AzureNetAppFilesManagementClientImpl client) { + this.service = retrofit.create(VolumesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Volumes to be + * used by Retrofit to perform actually REST calls. + */ + interface VolumesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumeInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumeInner body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumePatch body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Body VolumePatch body, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes revert" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert") + Observable> revert(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VolumeRevert body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginRevert" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert") + Observable> beginRevert(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VolumeRevert body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes breakReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication") + Observable> breakReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginBreakReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication") + Observable> beginBreakReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes replicationStatusMethod" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus") + Observable> replicationStatusMethod(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes resyncReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication") + Observable> resyncReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginResyncReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication") + Observable> beginResyncReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes deleteReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication") + Observable> deleteReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginDeleteReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication") + Observable> beginDeleteReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes authorizeReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication") + Observable> authorizeReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizeRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.netapp.v2020_03_01.Volumes beginAuthorizeReplication" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication") + Observable> beginAuthorizeReplication(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("volumeName") String volumeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AuthorizeRequest body, @Header("User-Agent") String userAgent); + + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<VolumeInner> object if successful. + */ + public List list(String resourceGroupName, String accountName, String poolName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<VolumeInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName, String poolName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Describe all volumes. + * List all volumes within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<VolumeInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, poolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner get(String resourceGroupName, String accountName, String poolName, String volumeName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Describe a volume. + * Get the details of the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner createOrUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().last().body(); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner beginCreateOrUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().single().body(); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update a volume. + * Create or update the specified volume within the capacity pool. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumeInner body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner update(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().last().body(); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeInner object if successful. + */ + public VolumeInner beginUpdate(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).toBlocking().single().body(); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body), serviceCallback); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, body).map(new Func1, VolumeInner>() { + @Override + public VolumeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a volume. + * Patch the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param body Volume object supplied in the body of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, VolumePatch body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, body, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String poolName, String volumeName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a volume. + * Delete the specified volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void revert(String resourceGroupName, String accountName, String poolName, String volumeName) { + revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> revertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String snapshotId = null; + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(null); + Observable> observable = service.revert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void revert(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).toBlocking().last().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable revertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + return revertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> revertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(snapshotId); + Observable> observable = service.revert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRevert(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRevertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String snapshotId = null; + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(null); + return service.beginRevert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRevertDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRevert(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).toBlocking().single().body(); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId), serviceCallback); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRevertAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + return beginRevertWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, snapshotId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revert a volume to one of its snapshots. + * Revert a volume to the snapshot specified in the body. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param snapshotId Resource id of the snapshot + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRevertWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String snapshotId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + VolumeRevert body = new VolumeRevert(); + body.withSnapshotId(snapshotId); + return service.beginRevert(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRevertDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRevertDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void breakReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable breakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return breakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> breakReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.breakReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginBreakReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginBreakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginBreakReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginBreakReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Break volume replication. + * Break the replication connection on the destination volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginBreakReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginBreakReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginBreakReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginBreakReplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationStatusInner object if successful. + */ + public ReplicationStatusInner replicationStatusMethod(String resourceGroupName, String accountName, String poolName, String volumeName) { + return replicationStatusMethodWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(replicationStatusMethodWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationStatusInner object + */ + public Observable replicationStatusMethodAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return replicationStatusMethodWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, ReplicationStatusInner>() { + @Override + public ReplicationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get volume replication status. + * Get the status of the replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationStatusInner object + */ + public Observable> replicationStatusMethodWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.replicationStatusMethod(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = replicationStatusMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse replicationStatusMethodDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + resyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return resyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resyncReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.resyncReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResyncReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginResyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResyncReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginResyncReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resync volume replication. + * Resync the connection on the destination volume. If the operation is ran on the source volume it will reverse-resync the connection and sync from source to destination. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResyncReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginResyncReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResyncReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResyncReplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + deleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return deleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginDeleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginDeleteReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete volume replication. + * Delete the replication connection on the destination volume, and send release to the source replication. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteReplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void authorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().last().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> authorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String remoteVolumeResourceId = null; + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(null); + Observable> observable = service.authorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void authorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).toBlocking().last().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable authorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + return authorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> authorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(remoteVolumeResourceId); + Observable> observable = service.authorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginAuthorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName) { + beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).toBlocking().single().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + return beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAuthorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String remoteVolumeResourceId = null; + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(null); + return service.beginAuthorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAuthorizeReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginAuthorizeReplication(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).toBlocking().single().body(); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId), serviceCallback); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAuthorizeReplicationAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + return beginAuthorizeReplicationWithServiceResponseAsync(resourceGroupName, accountName, poolName, volumeName, remoteVolumeResourceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Authorize source volume replication. + * Authorize the replication connection on the source volume. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the NetApp account + * @param poolName The name of the capacity pool + * @param volumeName The name of the volume + * @param remoteVolumeResourceId Resource id of the remote volume + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAuthorizeReplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, String volumeName, String remoteVolumeResourceId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + AuthorizeRequest body = new AuthorizeRequest(); + body.withRemoteVolumeResourceId(remoteVolumeResourceId); + return service.beginAuthorizeReplication(this.client.subscriptionId(), resourceGroupName, accountName, poolName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAuthorizeReplicationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginAuthorizeReplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/package-info.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/package-info.java new file mode 100644 index 0000000000000..4d6933190796c --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AzureNetAppFilesManagementClient. + * Microsoft NetApp Azure Resource Provider specification. + */ +package com.microsoft.azure.management.netapp.v2020_03_01.implementation; diff --git a/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/package-info.java b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/package-info.java new file mode 100644 index 0000000000000..aa35ae5f1821a --- /dev/null +++ b/sdk/netapp/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/netapp/v2020_03_01/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AzureNetAppFilesManagementClient. + * Microsoft NetApp Azure Resource Provider specification. + */ +package com.microsoft.azure.management.netapp.v2020_03_01;