From a2ef7158b803522a223ab810c2d44fdc250085f9 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 21 Apr 2020 20:11:44 +0000 Subject: [PATCH] Generated from b98b9fbafd8ee599cf3155bdf89f5d56a7b582e6 Fix config for Java SDK --- sdk/storagecache/mgmt-v2020_03_01/pom.xml | 135 ++ .../v2020_03_01/ApiOperation.java | 30 + .../v2020_03_01/ApiOperationDisplay.java | 95 + .../storagecache/v2020_03_01/Cache.java | 340 +++ .../v2020_03_01/CacheEncryptionSettings.java | 43 + .../storagecache/v2020_03_01/CacheHealth.java | 72 + .../v2020_03_01/CacheIdentity.java | 74 + .../v2020_03_01/CacheIdentityType.java | 53 + .../v2020_03_01/CacheNetworkSettings.java | 59 + .../v2020_03_01/CacheSecuritySettings.java | 43 + .../storagecache/v2020_03_01/CacheSku.java | 43 + .../v2020_03_01/CacheUpgradeStatus.java | 98 + .../storagecache/v2020_03_01/Caches.java | 65 + .../storagecache/v2020_03_01/ClfsTarget.java | 43 + .../v2020_03_01/ClfsTargetProperties.java | 20 + .../v2020_03_01/CloudErrorBody.java | 125 ++ .../v2020_03_01/FirmwareStatusType.java | 41 + .../v2020_03_01/HealthStateType.java | 62 + .../v2020_03_01/KeyVaultKeyReference.java | 69 + .../KeyVaultKeyReferenceSourceVault.java | 43 + .../v2020_03_01/NamespaceJunction.java | 95 + .../storagecache/v2020_03_01/Nfs3Target.java | 70 + .../v2020_03_01/Nfs3TargetProperties.java | 20 + .../storagecache/v2020_03_01/Operations.java | 27 + .../v2020_03_01/ProvisioningStateType.java | 53 + .../storagecache/v2020_03_01/ReasonCode.java | 41 + .../storagecache/v2020_03_01/ResourceSku.java | 51 + .../v2020_03_01/ResourceSkuCapabilities.java | 69 + .../v2020_03_01/ResourceSkuLocationInfo.java | 70 + .../storagecache/v2020_03_01/Restriction.java | 81 + .../storagecache/v2020_03_01/Skus.java | 19 + .../v2020_03_01/StorageTarget.java | 263 +++ .../v2020_03_01/StorageTargetProperties.java | 187 ++ .../v2020_03_01/StorageTargetResource.java | 17 + .../v2020_03_01/StorageTargetType.java | 44 + .../v2020_03_01/StorageTargets.java | 53 + .../v2020_03_01/UnknownTarget.java | 45 + .../v2020_03_01/UnknownTargetProperties.java | 20 + .../storagecache/v2020_03_01/UsageModel.java | 35 + .../v2020_03_01/UsageModelDisplay.java | 43 + .../storagecache/v2020_03_01/UsageModels.java | 19 + .../implementation/ApiOperationImpl.java | 37 + .../implementation/ApiOperationInner.java | 71 + .../v2020_03_01/implementation/CacheImpl.java | 164 ++ .../implementation/CacheInner.java | 297 +++ .../implementation/CachesImpl.java | 162 ++ .../implementation/CachesInner.java | 1946 +++++++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 +++ .../v2020_03_01/implementation/PageImpl.java | 75 + .../implementation/ResourceSkuImpl.java | 65 + .../implementation/ResourceSkuInner.java | 158 ++ .../v2020_03_01/implementation/SkusImpl.java | 68 + .../v2020_03_01/implementation/SkusInner.java | 287 +++ .../StorageCacheManagementClientImpl.java | 254 +++ .../implementation/StorageCacheManager.java | 147 ++ .../implementation/StorageTargetImpl.java | 166 ++ .../implementation/StorageTargetInner.java | 185 ++ .../implementation/StorageTargetsImpl.java | 85 + .../implementation/StorageTargetsInner.java | 935 ++++++++ .../implementation/UsageModelImpl.java | 47 + .../implementation/UsageModelInner.java | 97 + .../implementation/UsageModelsImpl.java | 68 + .../implementation/UsageModelsInner.java | 287 +++ .../implementation/package-info.java | 11 + .../v2020_03_01/package-info.java | 11 + 67 files changed, 8887 insertions(+) create mode 100644 sdk/storagecache/mgmt-v2020_03_01/pom.xml create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperation.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperationDisplay.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Cache.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheEncryptionSettings.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheHealth.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentity.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentityType.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheNetworkSettings.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSecuritySettings.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSku.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheUpgradeStatus.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Caches.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTarget.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTargetProperties.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CloudErrorBody.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/FirmwareStatusType.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/HealthStateType.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReference.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReferenceSourceVault.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/NamespaceJunction.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3Target.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3TargetProperties.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Operations.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ProvisioningStateType.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ReasonCode.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSku.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuCapabilities.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuLocationInfo.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Restriction.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Skus.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTarget.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetProperties.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetResource.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetType.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargets.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTarget.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTargetProperties.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModel.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModelDisplay.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModels.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/IdParsingUtils.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/OperationsImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/OperationsInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/PageImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManagementClientImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManager.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsImpl.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsInner.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/package-info.java create mode 100644 sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/package-info.java diff --git a/sdk/storagecache/mgmt-v2020_03_01/pom.xml b/sdk/storagecache/mgmt-v2020_03_01/pom.xml new file mode 100644 index 0000000000000..9c5ec4cb01bbd --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.storagecache.v2020_03_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-storagecache + 1.0.0-beta + jar + Microsoft Azure SDK for StorageCache Management + This package contains Microsoft StorageCache 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/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperation.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperation.java new file mode 100644 index 0000000000000..157bb369a28ad --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.StorageCacheManager; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.ApiOperationInner; + +/** + * Type representing ApiOperation. + */ +public interface ApiOperation extends HasInner, HasManager { + /** + * @return the display value. + */ + ApiOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperationDisplay.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperationDisplay.java new file mode 100644 index 0000000000000..28196224599f4 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ApiOperationDisplay.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class ApiOperationDisplay { + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Service provider: Microsoft.StorageCache. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed: Cache, etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation type: Read, write, delete, etc. + * + * @param operation the operation value to set + * @return the ApiOperationDisplay object itself. + */ + public ApiOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get service provider: Microsoft.StorageCache. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft.StorageCache. + * + * @param provider the provider value to set + * @return the ApiOperationDisplay object itself. + */ + public ApiOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed: Cache, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed: Cache, etc. + * + * @param resource the resource value to set + * @return the ApiOperationDisplay object itself. + */ + public ApiOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Cache.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Cache.java new file mode 100644 index 0000000000000..5be1a9fccf82f --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Cache.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.storagecache.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.storagecache.v2020_03_01.implementation.StorageCacheManager; +import java.util.List; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.CacheInner; + +/** + * Type representing Cache. + */ +public interface Cache extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the cacheSizeGB value. + */ + Integer cacheSizeGB(); + + /** + * @return the encryptionSettings value. + */ + CacheEncryptionSettings encryptionSettings(); + + /** + * @return the health value. + */ + CacheHealth health(); + + /** + * @return the identity value. + */ + CacheIdentity identity(); + + /** + * @return the mountAddresses value. + */ + List mountAddresses(); + + /** + * @return the networkSettings value. + */ + CacheNetworkSettings networkSettings(); + + /** + * @return the provisioningState value. + */ + ProvisioningStateType provisioningState(); + + /** + * @return the securitySettings value. + */ + CacheSecuritySettings securitySettings(); + + /** + * @return the sku value. + */ + CacheSku sku(); + + /** + * @return the subnet value. + */ + String subnet(); + + /** + * @return the upgradeStatus value. + */ + CacheUpgradeStatus upgradeStatus(); + + /** + * The entirety of the Cache definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cache definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cache definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cache definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cache definition allowing to specify CacheSizeGB. + */ + interface WithCacheSizeGB { + /** + * Specifies cacheSizeGB. + * @param cacheSizeGB The size of this Cache, in GB + * @return the next definition stage + */ + WithCreate withCacheSizeGB(Integer cacheSizeGB); + } + + /** + * The stage of the cache definition allowing to specify EncryptionSettings. + */ + interface WithEncryptionSettings { + /** + * Specifies encryptionSettings. + * @param encryptionSettings Specifies encryption settings of the cache + * @return the next definition stage + */ + WithCreate withEncryptionSettings(CacheEncryptionSettings encryptionSettings); + } + + /** + * The stage of the cache definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the cache, if configured + * @return the next definition stage + */ + WithCreate withIdentity(CacheIdentity identity); + } + + /** + * The stage of the cache definition allowing to specify NetworkSettings. + */ + interface WithNetworkSettings { + /** + * Specifies networkSettings. + * @param networkSettings Specifies network settings of the cache + * @return the next definition stage + */ + WithCreate withNetworkSettings(CacheNetworkSettings networkSettings); + } + + /** + * The stage of the cache definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningStateType provisioningState); + } + + /** + * The stage of the cache definition allowing to specify SecuritySettings. + */ + interface WithSecuritySettings { + /** + * Specifies securitySettings. + * @param securitySettings Specifies security settings of the cache + * @return the next definition stage + */ + WithCreate withSecuritySettings(CacheSecuritySettings securitySettings); + } + + /** + * The stage of the cache definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku SKU for the Cache + * @return the next definition stage + */ + WithCreate withSku(CacheSku sku); + } + + /** + * The stage of the cache definition allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @param subnet Subnet used for the Cache + * @return the next definition stage + */ + WithCreate withSubnet(String subnet); + } + + /** + * The stage of the cache definition allowing to specify UpgradeStatus. + */ + interface WithUpgradeStatus { + /** + * Specifies upgradeStatus. + * @param upgradeStatus Upgrade status of the Cache + * @return the next definition stage + */ + WithCreate withUpgradeStatus(CacheUpgradeStatus upgradeStatus); + } + + /** + * 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.WithCacheSizeGB, DefinitionStages.WithEncryptionSettings, DefinitionStages.WithIdentity, DefinitionStages.WithNetworkSettings, DefinitionStages.WithProvisioningState, DefinitionStages.WithSecuritySettings, DefinitionStages.WithSku, DefinitionStages.WithSubnet, DefinitionStages.WithUpgradeStatus { + } + } + /** + * The template for a Cache update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCacheSizeGB, UpdateStages.WithEncryptionSettings, UpdateStages.WithIdentity, UpdateStages.WithNetworkSettings, UpdateStages.WithProvisioningState, UpdateStages.WithSecuritySettings, UpdateStages.WithSku, UpdateStages.WithSubnet, UpdateStages.WithUpgradeStatus { + } + + /** + * Grouping of Cache update stages. + */ + interface UpdateStages { + /** + * The stage of the cache update allowing to specify CacheSizeGB. + */ + interface WithCacheSizeGB { + /** + * Specifies cacheSizeGB. + * @param cacheSizeGB The size of this Cache, in GB + * @return the next update stage + */ + Update withCacheSizeGB(Integer cacheSizeGB); + } + + /** + * The stage of the cache update allowing to specify EncryptionSettings. + */ + interface WithEncryptionSettings { + /** + * Specifies encryptionSettings. + * @param encryptionSettings Specifies encryption settings of the cache + * @return the next update stage + */ + Update withEncryptionSettings(CacheEncryptionSettings encryptionSettings); + } + + /** + * The stage of the cache update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the cache, if configured + * @return the next update stage + */ + Update withIdentity(CacheIdentity identity); + } + + /** + * The stage of the cache update allowing to specify NetworkSettings. + */ + interface WithNetworkSettings { + /** + * Specifies networkSettings. + * @param networkSettings Specifies network settings of the cache + * @return the next update stage + */ + Update withNetworkSettings(CacheNetworkSettings networkSettings); + } + + /** + * The stage of the cache update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningStateType provisioningState); + } + + /** + * The stage of the cache update allowing to specify SecuritySettings. + */ + interface WithSecuritySettings { + /** + * Specifies securitySettings. + * @param securitySettings Specifies security settings of the cache + * @return the next update stage + */ + Update withSecuritySettings(CacheSecuritySettings securitySettings); + } + + /** + * The stage of the cache update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku SKU for the Cache + * @return the next update stage + */ + Update withSku(CacheSku sku); + } + + /** + * The stage of the cache update allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @param subnet Subnet used for the Cache + * @return the next update stage + */ + Update withSubnet(String subnet); + } + + /** + * The stage of the cache update allowing to specify UpgradeStatus. + */ + interface WithUpgradeStatus { + /** + * Specifies upgradeStatus. + * @param upgradeStatus Upgrade status of the Cache + * @return the next update stage + */ + Update withUpgradeStatus(CacheUpgradeStatus upgradeStatus); + } + + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheEncryptionSettings.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheEncryptionSettings.java new file mode 100644 index 0000000000000..a0a23598beb96 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheEncryptionSettings.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cache encryption settings. + */ +public class CacheEncryptionSettings { + /** + * Specifies the location of the key encryption key in Key Vault. + */ + @JsonProperty(value = "keyEncryptionKey") + private KeyVaultKeyReference keyEncryptionKey; + + /** + * Get specifies the location of the key encryption key in Key Vault. + * + * @return the keyEncryptionKey value + */ + public KeyVaultKeyReference keyEncryptionKey() { + return this.keyEncryptionKey; + } + + /** + * Set specifies the location of the key encryption key in Key Vault. + * + * @param keyEncryptionKey the keyEncryptionKey value to set + * @return the CacheEncryptionSettings object itself. + */ + public CacheEncryptionSettings withKeyEncryptionKey(KeyVaultKeyReference keyEncryptionKey) { + this.keyEncryptionKey = keyEncryptionKey; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheHealth.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheHealth.java new file mode 100644 index 0000000000000..25de6d1976a89 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheHealth.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An indication of Cache health. Gives more information about health than just + * that related to provisioning. + */ +public class CacheHealth { + /** + * List of Cache health states. Possible values include: 'Unknown', + * 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', 'Stopped', + * 'Upgrading', 'Flushing'. + */ + @JsonProperty(value = "state") + private HealthStateType state; + + /** + * Describes explanation of state. + */ + @JsonProperty(value = "statusDescription") + private String statusDescription; + + /** + * Get list of Cache health states. Possible values include: 'Unknown', 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', 'Stopped', 'Upgrading', 'Flushing'. + * + * @return the state value + */ + public HealthStateType state() { + return this.state; + } + + /** + * Set list of Cache health states. Possible values include: 'Unknown', 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', 'Stopped', 'Upgrading', 'Flushing'. + * + * @param state the state value to set + * @return the CacheHealth object itself. + */ + public CacheHealth withState(HealthStateType state) { + this.state = state; + return this; + } + + /** + * Get describes explanation of state. + * + * @return the statusDescription value + */ + public String statusDescription() { + return this.statusDescription; + } + + /** + * Set describes explanation of state. + * + * @param statusDescription the statusDescription value to set + * @return the CacheHealth object itself. + */ + public CacheHealth withStatusDescription(String statusDescription) { + this.statusDescription = statusDescription; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentity.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentity.java new file mode 100644 index 0000000000000..2a22a660044de --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentity.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cache identity properties. + */ +public class CacheIdentity { + /** + * The principal id of the cache. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id associated with the cache. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The type of identity used for the cache. Possible values include: + * 'SystemAssigned', 'None'. + */ + @JsonProperty(value = "type") + private CacheIdentityType type; + + /** + * Get the principal id of the cache. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id associated with the cache. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type of identity used for the cache. Possible values include: 'SystemAssigned', 'None'. + * + * @return the type value + */ + public CacheIdentityType type() { + return this.type; + } + + /** + * Set the type of identity used for the cache. Possible values include: 'SystemAssigned', 'None'. + * + * @param type the type value to set + * @return the CacheIdentity object itself. + */ + public CacheIdentity withType(CacheIdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentityType.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentityType.java new file mode 100644 index 0000000000000..b548947aea440 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheIdentityType.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CacheIdentityType. + */ +public enum CacheIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a CacheIdentityType instance. */ + private String value; + + CacheIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CacheIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed CacheIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static CacheIdentityType fromString(String value) { + CacheIdentityType[] items = CacheIdentityType.values(); + for (CacheIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheNetworkSettings.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheNetworkSettings.java new file mode 100644 index 0000000000000..3784adc8c3ab1 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheNetworkSettings.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cache network settings. + */ +public class CacheNetworkSettings { + /** + * The IPv4 maximum transmission unit configured for the subnet. + */ + @JsonProperty(value = "mtu") + private Integer mtu; + + /** + * Array of additional IP addresses used by this Cache. + */ + @JsonProperty(value = "utilityAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List utilityAddresses; + + /** + * Get the IPv4 maximum transmission unit configured for the subnet. + * + * @return the mtu value + */ + public Integer mtu() { + return this.mtu; + } + + /** + * Set the IPv4 maximum transmission unit configured for the subnet. + * + * @param mtu the mtu value to set + * @return the CacheNetworkSettings object itself. + */ + public CacheNetworkSettings withMtu(Integer mtu) { + this.mtu = mtu; + return this; + } + + /** + * Get array of additional IP addresses used by this Cache. + * + * @return the utilityAddresses value + */ + public List utilityAddresses() { + return this.utilityAddresses; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSecuritySettings.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSecuritySettings.java new file mode 100644 index 0000000000000..e8390c366e2ce --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSecuritySettings.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cache security settings. + */ +public class CacheSecuritySettings { + /** + * root squash of cache property. + */ + @JsonProperty(value = "rootSquash") + private Boolean rootSquash; + + /** + * Get root squash of cache property. + * + * @return the rootSquash value + */ + public Boolean rootSquash() { + return this.rootSquash; + } + + /** + * Set root squash of cache property. + * + * @param rootSquash the rootSquash value to set + * @return the CacheSecuritySettings object itself. + */ + public CacheSecuritySettings withRootSquash(Boolean rootSquash) { + this.rootSquash = rootSquash; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSku.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSku.java new file mode 100644 index 0000000000000..0b28b4913b07a --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheSku.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU for the Cache. + */ +public class CacheSku { + /** + * SKU name for this Cache. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get sKU name for this Cache. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set sKU name for this Cache. + * + * @param name the name value to set + * @return the CacheSku object itself. + */ + public CacheSku withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheUpgradeStatus.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheUpgradeStatus.java new file mode 100644 index 0000000000000..1b63ed3e86d12 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CacheUpgradeStatus.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties describing the software upgrade state of the Cache. + */ +public class CacheUpgradeStatus { + /** + * Version string of the firmware currently installed on this Cache. + */ + @JsonProperty(value = "currentFirmwareVersion", access = JsonProperty.Access.WRITE_ONLY) + private String currentFirmwareVersion; + + /** + * True if there is a firmware update ready to install on this Cache. The + * firmware will automatically be installed after firmwareUpdateDeadline if + * not triggered earlier via the upgrade operation. Possible values + * include: 'available', 'unavailable'. + */ + @JsonProperty(value = "firmwareUpdateStatus", access = JsonProperty.Access.WRITE_ONLY) + private FirmwareStatusType firmwareUpdateStatus; + + /** + * Time at which the pending firmware update will automatically be + * installed on the Cache. + */ + @JsonProperty(value = "firmwareUpdateDeadline", access = JsonProperty.Access.WRITE_ONLY) + private DateTime firmwareUpdateDeadline; + + /** + * Time of the last successful firmware update. + */ + @JsonProperty(value = "lastFirmwareUpdate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastFirmwareUpdate; + + /** + * When firmwareUpdateAvailable is true, this field holds the version + * string for the update. + */ + @JsonProperty(value = "pendingFirmwareVersion", access = JsonProperty.Access.WRITE_ONLY) + private String pendingFirmwareVersion; + + /** + * Get version string of the firmware currently installed on this Cache. + * + * @return the currentFirmwareVersion value + */ + public String currentFirmwareVersion() { + return this.currentFirmwareVersion; + } + + /** + * Get true if there is a firmware update ready to install on this Cache. The firmware will automatically be installed after firmwareUpdateDeadline if not triggered earlier via the upgrade operation. Possible values include: 'available', 'unavailable'. + * + * @return the firmwareUpdateStatus value + */ + public FirmwareStatusType firmwareUpdateStatus() { + return this.firmwareUpdateStatus; + } + + /** + * Get time at which the pending firmware update will automatically be installed on the Cache. + * + * @return the firmwareUpdateDeadline value + */ + public DateTime firmwareUpdateDeadline() { + return this.firmwareUpdateDeadline; + } + + /** + * Get time of the last successful firmware update. + * + * @return the lastFirmwareUpdate value + */ + public DateTime lastFirmwareUpdate() { + return this.lastFirmwareUpdate; + } + + /** + * Get when firmwareUpdateAvailable is true, this field holds the version string for the update. + * + * @return the pendingFirmwareVersion value + */ + public String pendingFirmwareVersion() { + return this.pendingFirmwareVersion; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Caches.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Caches.java new file mode 100644 index 0000000000000..9542efe114e9a --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Caches.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.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.arm.collection.SupportsListing; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.CachesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Caches. + */ +public interface Caches extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable flushAsync(String resourceGroupName, String cacheName); + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable startAsync(String resourceGroupName, String cacheName); + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable stopAsync(String resourceGroupName, String cacheName); + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable upgradeFirmwareAsync(String resourceGroupName, String cacheName); + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTarget.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTarget.java new file mode 100644 index 0000000000000..c64d31e1c341a --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTarget.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties pertained to ClfsTarget. + */ +public class ClfsTarget { + /** + * Resource ID of storage container. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get resource ID of storage container. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set resource ID of storage container. + * + * @param target the target value to set + * @return the ClfsTarget object itself. + */ + public ClfsTarget withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTargetProperties.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTargetProperties.java new file mode 100644 index 0000000000000..116ff62d4d2ad --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ClfsTargetProperties.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Storage container for use as a CLFS Storage Target. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "targetBaseType", defaultImpl = ClfsTargetProperties.class) +@JsonTypeName("clfs") +public class ClfsTargetProperties extends StorageTargetProperties { +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CloudErrorBody.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CloudErrorBody.java new file mode 100644 index 0000000000000..dd3628c30b440 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/CloudErrorBody.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.storagecache.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response. + */ +public class CloudErrorBody { + /** + * An identifier for the error. Codes are invariant and are intended to be + * consumed programmatically. + */ + @JsonProperty(value = "code") + private String code; + + /** + * A list of additional details about the error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * A message describing the error, intended to be suitable for display in a + * user interface. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target of the particular error. For example, the name of the + * property in error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @param code the code value to set + * @return the CloudErrorBody object itself. + */ + public CloudErrorBody withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a list of additional details about the error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set a list of additional details about the error. + * + * @param details the details value to set + * @return the CloudErrorBody object itself. + */ + public CloudErrorBody withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get a message describing the error, intended to be suitable for display in a user interface. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a message describing the error, intended to be suitable for display in a user interface. + * + * @param message the message value to set + * @return the CloudErrorBody object itself. + */ + public CloudErrorBody withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target of the particular error. For example, the name of the property in error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the particular error. For example, the name of the property in error. + * + * @param target the target value to set + * @return the CloudErrorBody object itself. + */ + public CloudErrorBody withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/FirmwareStatusType.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/FirmwareStatusType.java new file mode 100644 index 0000000000000..f99fed295b045 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/FirmwareStatusType.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.storagecache.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FirmwareStatusType. + */ +public final class FirmwareStatusType extends ExpandableStringEnum { + /** Static value available for FirmwareStatusType. */ + public static final FirmwareStatusType AVAILABLE = fromString("available"); + + /** Static value unavailable for FirmwareStatusType. */ + public static final FirmwareStatusType UNAVAILABLE = fromString("unavailable"); + + /** + * Creates or finds a FirmwareStatusType from its string representation. + * @param name a name to look for + * @return the corresponding FirmwareStatusType + */ + @JsonCreator + public static FirmwareStatusType fromString(String name) { + return fromString(name, FirmwareStatusType.class); + } + + /** + * @return known FirmwareStatusType values + */ + public static Collection values() { + return values(FirmwareStatusType.class); + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/HealthStateType.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/HealthStateType.java new file mode 100644 index 0000000000000..43f6c4e74358c --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/HealthStateType.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.storagecache.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HealthStateType. + */ +public final class HealthStateType extends ExpandableStringEnum { + /** Static value Unknown for HealthStateType. */ + public static final HealthStateType UNKNOWN = fromString("Unknown"); + + /** Static value Healthy for HealthStateType. */ + public static final HealthStateType HEALTHY = fromString("Healthy"); + + /** Static value Degraded for HealthStateType. */ + public static final HealthStateType DEGRADED = fromString("Degraded"); + + /** Static value Down for HealthStateType. */ + public static final HealthStateType DOWN = fromString("Down"); + + /** Static value Transitioning for HealthStateType. */ + public static final HealthStateType TRANSITIONING = fromString("Transitioning"); + + /** Static value Stopping for HealthStateType. */ + public static final HealthStateType STOPPING = fromString("Stopping"); + + /** Static value Stopped for HealthStateType. */ + public static final HealthStateType STOPPED = fromString("Stopped"); + + /** Static value Upgrading for HealthStateType. */ + public static final HealthStateType UPGRADING = fromString("Upgrading"); + + /** Static value Flushing for HealthStateType. */ + public static final HealthStateType FLUSHING = fromString("Flushing"); + + /** + * Creates or finds a HealthStateType from its string representation. + * @param name a name to look for + * @return the corresponding HealthStateType + */ + @JsonCreator + public static HealthStateType fromString(String name) { + return fromString(name, HealthStateType.class); + } + + /** + * @return known HealthStateType values + */ + public static Collection values() { + return values(HealthStateType.class); + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReference.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReference.java new file mode 100644 index 0000000000000..4bbcb45ba1907 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReference.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a reference to Key Vault Key. + */ +public class KeyVaultKeyReference { + /** + * The URL referencing a key encryption key in Key Vault. + */ + @JsonProperty(value = "keyUrl", required = true) + private String keyUrl; + + /** + * Describes a resource Id to source Key Vault. + */ + @JsonProperty(value = "sourceVault", required = true) + private KeyVaultKeyReferenceSourceVault sourceVault; + + /** + * Get the URL referencing a key encryption key in Key Vault. + * + * @return the keyUrl value + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the URL referencing a key encryption key in Key Vault. + * + * @param keyUrl the keyUrl value to set + * @return the KeyVaultKeyReference object itself. + */ + public KeyVaultKeyReference withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Get describes a resource Id to source Key Vault. + * + * @return the sourceVault value + */ + public KeyVaultKeyReferenceSourceVault sourceVault() { + return this.sourceVault; + } + + /** + * Set describes a resource Id to source Key Vault. + * + * @param sourceVault the sourceVault value to set + * @return the KeyVaultKeyReference object itself. + */ + public KeyVaultKeyReference withSourceVault(KeyVaultKeyReferenceSourceVault sourceVault) { + this.sourceVault = sourceVault; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReferenceSourceVault.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReferenceSourceVault.java new file mode 100644 index 0000000000000..3f377f9dc046d --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/KeyVaultKeyReferenceSourceVault.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a resource Id to source Key Vault. + */ +public class KeyVaultKeyReferenceSourceVault { + /** + * Resource Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get resource Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource Id. + * + * @param id the id value to set + * @return the KeyVaultKeyReferenceSourceVault object itself. + */ + public KeyVaultKeyReferenceSourceVault withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/NamespaceJunction.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/NamespaceJunction.java new file mode 100644 index 0000000000000..cd4584d91bb3f --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/NamespaceJunction.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A namespace junction. + */ +public class NamespaceJunction { + /** + * Namespace path on a Cache for a Storage Target. + */ + @JsonProperty(value = "namespacePath") + private String namespacePath; + + /** + * Path in Storage Target to which namespacePath points. + */ + @JsonProperty(value = "targetPath") + private String targetPath; + + /** + * NFS export where targetPath exists. + */ + @JsonProperty(value = "nfsExport") + private String nfsExport; + + /** + * Get namespace path on a Cache for a Storage Target. + * + * @return the namespacePath value + */ + public String namespacePath() { + return this.namespacePath; + } + + /** + * Set namespace path on a Cache for a Storage Target. + * + * @param namespacePath the namespacePath value to set + * @return the NamespaceJunction object itself. + */ + public NamespaceJunction withNamespacePath(String namespacePath) { + this.namespacePath = namespacePath; + return this; + } + + /** + * Get path in Storage Target to which namespacePath points. + * + * @return the targetPath value + */ + public String targetPath() { + return this.targetPath; + } + + /** + * Set path in Storage Target to which namespacePath points. + * + * @param targetPath the targetPath value to set + * @return the NamespaceJunction object itself. + */ + public NamespaceJunction withTargetPath(String targetPath) { + this.targetPath = targetPath; + return this; + } + + /** + * Get nFS export where targetPath exists. + * + * @return the nfsExport value + */ + public String nfsExport() { + return this.nfsExport; + } + + /** + * Set nFS export where targetPath exists. + * + * @param nfsExport the nfsExport value to set + * @return the NamespaceJunction object itself. + */ + public NamespaceJunction withNfsExport(String nfsExport) { + this.nfsExport = nfsExport; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3Target.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3Target.java new file mode 100644 index 0000000000000..f4156f08fa79f --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3Target.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties pertained to Nfs3Target. + */ +public class Nfs3Target { + /** + * IP address or host name of an NFSv3 host (e.g., 10.0.44.44). + */ + @JsonProperty(value = "target") + private String target; + + /** + * Identifies the primary usage model to be used for this Storage Target. + * Get choices from .../usageModels. + */ + @JsonProperty(value = "usageModel") + private String usageModel; + + /** + * Get iP address or host name of an NFSv3 host (e.g., 10.0.44.44). + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set iP address or host name of an NFSv3 host (e.g., 10.0.44.44). + * + * @param target the target value to set + * @return the Nfs3Target object itself. + */ + public Nfs3Target withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get identifies the primary usage model to be used for this Storage Target. Get choices from .../usageModels. + * + * @return the usageModel value + */ + public String usageModel() { + return this.usageModel; + } + + /** + * Set identifies the primary usage model to be used for this Storage Target. Get choices from .../usageModels. + * + * @param usageModel the usageModel value to set + * @return the Nfs3Target object itself. + */ + public Nfs3Target withUsageModel(String usageModel) { + this.usageModel = usageModel; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3TargetProperties.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3TargetProperties.java new file mode 100644 index 0000000000000..b51810523f97f --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Nfs3TargetProperties.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * An NFSv3 mount point for use as a Storage Target. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "targetBaseType", defaultImpl = Nfs3TargetProperties.class) +@JsonTypeName("nfs3") +public class Nfs3TargetProperties extends StorageTargetProperties { +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Operations.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Operations.java new file mode 100644 index 0000000000000..a4d19e36e5a09 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import rx.Observable; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ProvisioningStateType.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ProvisioningStateType.java new file mode 100644 index 0000000000000..08f9d56f30ebc --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ProvisioningStateType.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.storagecache.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningStateType. + */ +public final class ProvisioningStateType extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningStateType. */ + public static final ProvisioningStateType SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningStateType. */ + public static final ProvisioningStateType FAILED = fromString("Failed"); + + /** Static value Cancelled for ProvisioningStateType. */ + public static final ProvisioningStateType CANCELLED = fromString("Cancelled"); + + /** Static value Creating for ProvisioningStateType. */ + public static final ProvisioningStateType CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningStateType. */ + public static final ProvisioningStateType DELETING = fromString("Deleting"); + + /** Static value Updating for ProvisioningStateType. */ + public static final ProvisioningStateType UPDATING = fromString("Updating"); + + /** + * Creates or finds a ProvisioningStateType from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningStateType + */ + @JsonCreator + public static ProvisioningStateType fromString(String name) { + return fromString(name, ProvisioningStateType.class); + } + + /** + * @return known ProvisioningStateType values + */ + public static Collection values() { + return values(ProvisioningStateType.class); + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ReasonCode.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ReasonCode.java new file mode 100644 index 0000000000000..4a582bf8f9db3 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ReasonCode.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.storagecache.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReasonCode. + */ +public final class ReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ReasonCode. */ + public static final ReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ReasonCode. */ + public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ReasonCode from its string representation. + * @param name a name to look for + * @return the corresponding ReasonCode + */ + @JsonCreator + public static ReasonCode fromString(String name) { + return fromString(name, ReasonCode.class); + } + + /** + * @return known ReasonCode values + */ + public static Collection values() { + return values(ReasonCode.class); + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSku.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSku.java new file mode 100644 index 0000000000000..bff0cf73f26c9 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSku.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.ResourceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.StorageCacheManager; +import java.util.List; + +/** + * Type representing ResourceSku. + */ +public interface ResourceSku extends HasInner, HasManager { + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuCapabilities.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..74dfd46bc9aea --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuCapabilities.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource SKU capability. + */ +public class ResourceSkuCapabilities { + /** + * Name of a capability, such as ops/sec. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Quantity, if the capability is measured by quantity. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get name of a capability, such as ops/sec. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of a capability, such as ops/sec. + * + * @param name the name value to set + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withName(String name) { + this.name = name; + return this; + } + + /** + * Get quantity, if the capability is measured by quantity. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set quantity, if the capability is measured by quantity. + * + * @param value the value value to set + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuLocationInfo.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuLocationInfo.java new file mode 100644 index 0000000000000..7c5eac8d11896 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/ResourceSkuLocationInfo.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource SKU location information. + */ +public class ResourceSkuLocationInfo { + /** + * Location where this SKU is available. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Zones if any. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get location where this SKU is available. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location where this SKU is available. + * + * @param location the location value to set + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get zones if any. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set zones if any. + * + * @param zones the zones value to set + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Restriction.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Restriction.java new file mode 100644 index 0000000000000..e5655a694b8fb --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Restriction.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The restrictions preventing this SKU from being used. + */ +public class Restriction { + /** + * The type of restrictions. In this version, the only possible value for + * this is location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The value of restrictions. If the restriction type is set to location, + * then this would be the different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /** + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". "QuotaId" is set when the SKU has + * requiredQuotas parameter as the subscription does not belong to that + * quota. "NotAvailableForSubscription" is related to capacity at the + * datacenter. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode") + private ReasonCode reasonCode; + + /** + * Get the type of restrictions. In this version, the only possible value for this is location. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the value of restrictions. If the restriction type is set to location, then this would be the different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Get the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". "QuotaId" is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. "NotAvailableForSubscription" is related to capacity at the datacenter. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". "QuotaId" is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. "NotAvailableForSubscription" is related to capacity at the datacenter. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set + * @return the Restriction object itself. + */ + public Restriction withReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Skus.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Skus.java new file mode 100644 index 0000000000000..c80e1dc52d534 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/Skus.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.SkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Skus. + */ +public interface Skus extends SupportsListing, HasInner { +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTarget.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTarget.java new file mode 100644 index 0000000000000..aab56b5b59522 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTarget.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.StorageTargetInner; +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.storagecache.v2020_03_01.implementation.StorageCacheManager; +import java.util.List; + +/** + * Type representing StorageTarget. + */ +public interface StorageTarget extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the clfs value. + */ + ClfsTarget clfs(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the junctions value. + */ + List junctions(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nfs3 value. + */ + Nfs3Target nfs3(); + + /** + * @return the provisioningState value. + */ + ProvisioningStateType provisioningState(); + + /** + * @return the targetType value. + */ + String targetType(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the unknown value. + */ + UnknownTarget unknown(); + + /** + * The entirety of the StorageTarget definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCach, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageTarget definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageTarget definition. + */ + interface Blank extends WithCach { + } + + /** + * The stage of the storagetarget definition allowing to specify Cach. + */ + interface WithCach { + /** + * Specifies resourceGroupName, cacheName. + * @param resourceGroupName Target resource group + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class + * @return the next definition stage + */ + WithCreate withExistingCach(String resourceGroupName, String cacheName); + } + + /** + * The stage of the storagetarget definition allowing to specify Clfs. + */ + interface WithClfs { + /** + * Specifies clfs. + * @param clfs Properties when targetType is clfs + * @return the next definition stage + */ + WithCreate withClfs(ClfsTarget clfs); + } + + /** + * The stage of the storagetarget definition allowing to specify Junctions. + */ + interface WithJunctions { + /** + * Specifies junctions. + * @param junctions List of Cache namespace junctions to target for namespace associations + * @return the next definition stage + */ + WithCreate withJunctions(List junctions); + } + + /** + * The stage of the storagetarget definition allowing to specify Nfs3. + */ + interface WithNfs3 { + /** + * Specifies nfs3. + * @param nfs3 Properties when targetType is nfs3 + * @return the next definition stage + */ + WithCreate withNfs3(Nfs3Target nfs3); + } + + /** + * The stage of the storagetarget definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + * @return the next definition stage + */ + WithCreate withProvisioningState(ProvisioningStateType provisioningState); + } + + /** + * The stage of the storagetarget definition allowing to specify TargetType. + */ + interface WithTargetType { + /** + * Specifies targetType. + * @param targetType Type of the Storage Target + * @return the next definition stage + */ + WithCreate withTargetType(String targetType); + } + + /** + * The stage of the storagetarget definition allowing to specify Unknown. + */ + interface WithUnknown { + /** + * Specifies unknown. + * @param unknown Properties when targetType is unknown + * @return the next definition stage + */ + WithCreate withUnknown(UnknownTarget unknown); + } + + /** + * 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.WithClfs, DefinitionStages.WithJunctions, DefinitionStages.WithNfs3, DefinitionStages.WithProvisioningState, DefinitionStages.WithTargetType, DefinitionStages.WithUnknown { + } + } + /** + * The template for a StorageTarget update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithClfs, UpdateStages.WithJunctions, UpdateStages.WithNfs3, UpdateStages.WithProvisioningState, UpdateStages.WithTargetType, UpdateStages.WithUnknown { + } + + /** + * Grouping of StorageTarget update stages. + */ + interface UpdateStages { + /** + * The stage of the storagetarget update allowing to specify Clfs. + */ + interface WithClfs { + /** + * Specifies clfs. + * @param clfs Properties when targetType is clfs + * @return the next update stage + */ + Update withClfs(ClfsTarget clfs); + } + + /** + * The stage of the storagetarget update allowing to specify Junctions. + */ + interface WithJunctions { + /** + * Specifies junctions. + * @param junctions List of Cache namespace junctions to target for namespace associations + * @return the next update stage + */ + Update withJunctions(List junctions); + } + + /** + * The stage of the storagetarget update allowing to specify Nfs3. + */ + interface WithNfs3 { + /** + * Specifies nfs3. + * @param nfs3 Properties when targetType is nfs3 + * @return the next update stage + */ + Update withNfs3(Nfs3Target nfs3); + } + + /** + * The stage of the storagetarget update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + * @return the next update stage + */ + Update withProvisioningState(ProvisioningStateType provisioningState); + } + + /** + * The stage of the storagetarget update allowing to specify TargetType. + */ + interface WithTargetType { + /** + * Specifies targetType. + * @param targetType Type of the Storage Target + * @return the next update stage + */ + Update withTargetType(String targetType); + } + + /** + * The stage of the storagetarget update allowing to specify Unknown. + */ + interface WithUnknown { + /** + * Specifies unknown. + * @param unknown Properties when targetType is unknown + * @return the next update stage + */ + Update withUnknown(UnknownTarget unknown); + } + + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetProperties.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetProperties.java new file mode 100644 index 0000000000000..10e1b14f7ab73 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetProperties.java @@ -0,0 +1,187 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Properties of the Storage Target. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "targetBaseType", defaultImpl = StorageTargetProperties.class) +@JsonTypeName("StorageTargetProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "nfs3", value = Nfs3TargetProperties.class), + @JsonSubTypes.Type(name = "clfs", value = ClfsTargetProperties.class), + @JsonSubTypes.Type(name = "unknown", value = UnknownTargetProperties.class) +}) +public class StorageTargetProperties { + /** + * List of Cache namespace junctions to target for namespace associations. + */ + @JsonProperty(value = "junctions") + private List junctions; + + /** + * Type of the Storage Target. + */ + @JsonProperty(value = "targetType") + private String targetType; + + /** + * ARM provisioning state, see + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + * Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + * 'Deleting', 'Updating'. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningStateType provisioningState; + + /** + * Properties when targetType is nfs3. + */ + @JsonProperty(value = "nfs3") + private Nfs3Target nfs3; + + /** + * Properties when targetType is clfs. + */ + @JsonProperty(value = "clfs") + private ClfsTarget clfs; + + /** + * Properties when targetType is unknown. + */ + @JsonProperty(value = "unknown") + private UnknownTarget unknown; + + /** + * Get list of Cache namespace junctions to target for namespace associations. + * + * @return the junctions value + */ + public List junctions() { + return this.junctions; + } + + /** + * Set list of Cache namespace junctions to target for namespace associations. + * + * @param junctions the junctions value to set + * @return the StorageTargetProperties object itself. + */ + public StorageTargetProperties withJunctions(List junctions) { + this.junctions = junctions; + return this; + } + + /** + * Get type of the Storage Target. + * + * @return the targetType value + */ + public String targetType() { + return this.targetType; + } + + /** + * Set type of the Storage Target. + * + * @param targetType the targetType value to set + * @return the StorageTargetProperties object itself. + */ + public StorageTargetProperties withTargetType(String targetType) { + this.targetType = targetType; + return this; + } + + /** + * Get aRM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public ProvisioningStateType provisioningState() { + return this.provisioningState; + } + + /** + * Set aRM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating'. + * + * @param provisioningState the provisioningState value to set + * @return the StorageTargetProperties object itself. + */ + public StorageTargetProperties withProvisioningState(ProvisioningStateType provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get properties when targetType is nfs3. + * + * @return the nfs3 value + */ + public Nfs3Target nfs3() { + return this.nfs3; + } + + /** + * Set properties when targetType is nfs3. + * + * @param nfs3 the nfs3 value to set + * @return the StorageTargetProperties object itself. + */ + public StorageTargetProperties withNfs3(Nfs3Target nfs3) { + this.nfs3 = nfs3; + return this; + } + + /** + * Get properties when targetType is clfs. + * + * @return the clfs value + */ + public ClfsTarget clfs() { + return this.clfs; + } + + /** + * Set properties when targetType is clfs. + * + * @param clfs the clfs value to set + * @return the StorageTargetProperties object itself. + */ + public StorageTargetProperties withClfs(ClfsTarget clfs) { + this.clfs = clfs; + return this; + } + + /** + * Get properties when targetType is unknown. + * + * @return the unknown value + */ + public UnknownTarget unknown() { + return this.unknown; + } + + /** + * Set properties when targetType is unknown. + * + * @param unknown the unknown value to set + * @return the StorageTargetProperties object itself. + */ + public StorageTargetProperties withUnknown(UnknownTarget unknown) { + this.unknown = unknown; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetResource.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetResource.java new file mode 100644 index 0000000000000..500173f47c04f --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetResource.java @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import com.microsoft.azure.ProxyResource; + +/** + * Resource used by a Cache. + */ +public class StorageTargetResource extends ProxyResource { +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetType.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetType.java new file mode 100644 index 0000000000000..c6a5c5eab467a --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargetType.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.storagecache.v2020_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StorageTargetType. + */ +public final class StorageTargetType extends ExpandableStringEnum { + /** Static value nfs3 for StorageTargetType. */ + public static final StorageTargetType NFS3 = fromString("nfs3"); + + /** Static value clfs for StorageTargetType. */ + public static final StorageTargetType CLFS = fromString("clfs"); + + /** Static value unknown for StorageTargetType. */ + public static final StorageTargetType UNKNOWN = fromString("unknown"); + + /** + * Creates or finds a StorageTargetType from its string representation. + * @param name a name to look for + * @return the corresponding StorageTargetType + */ + @JsonCreator + public static StorageTargetType fromString(String name) { + return fromString(name, StorageTargetType.class); + } + + /** + * @return known StorageTargetType values + */ + public static Collection values() { + return values(StorageTargetType.class); + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargets.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargets.java new file mode 100644 index 0000000000000..0639a62f19f79 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/StorageTargets.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.storagecache.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.StorageTargetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageTargets. + */ +public interface StorageTargets extends SupportsCreating, HasInner { + /** + * Returns a Storage Target from a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String cacheName, String storageTargetName); + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByCacheAsync(final String resourceGroupName, final String cacheName); + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String cacheName, String storageTargetName); + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTarget.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTarget.java new file mode 100644 index 0000000000000..d67a440f01447 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTarget.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.storagecache.v2020_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties pertained to UnknownTarget. + */ +public class UnknownTarget { + /** + * Dictionary of string->string pairs containing information about the + * Storage Target. + */ + @JsonProperty(value = "unknownMap") + private Map unknownMap; + + /** + * Get dictionary of string->string pairs containing information about the Storage Target. + * + * @return the unknownMap value + */ + public Map unknownMap() { + return this.unknownMap; + } + + /** + * Set dictionary of string->string pairs containing information about the Storage Target. + * + * @param unknownMap the unknownMap value to set + * @return the UnknownTarget object itself. + */ + public UnknownTarget withUnknownMap(Map unknownMap) { + this.unknownMap = unknownMap; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTargetProperties.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTargetProperties.java new file mode 100644 index 0000000000000..4a3a3d33ad0a1 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UnknownTargetProperties.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Storage container for use as an Unknown Storage Target. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "targetBaseType", defaultImpl = UnknownTargetProperties.class) +@JsonTypeName("unknown") +public class UnknownTargetProperties extends StorageTargetProperties { +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModel.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModel.java new file mode 100644 index 0000000000000..e3b2b1dd5b3be --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModel.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.storagecache.v2020_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.UsageModelInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.StorageCacheManager; + +/** + * Type representing UsageModel. + */ +public interface UsageModel extends HasInner, HasManager { + /** + * @return the display value. + */ + UsageModelDisplay display(); + + /** + * @return the modelName value. + */ + String modelName(); + + /** + * @return the targetType value. + */ + String targetType(); + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModelDisplay.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModelDisplay.java new file mode 100644 index 0000000000000..2edb66ec64a13 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModelDisplay.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.storagecache.v2020_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized information describing this usage model. + */ +public class UsageModelDisplay { + /** + * String to display for this usage model. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get string to display for this usage model. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set string to display for this usage model. + * + * @param description the description value to set + * @return the UsageModelDisplay object itself. + */ + public UsageModelDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModels.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModels.java new file mode 100644 index 0000000000000..533206373fe68 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/UsageModels.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.storagecache.v2020_03_01.implementation.UsageModelsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing UsageModels. + */ +public interface UsageModels extends SupportsListing, HasInner { +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationImpl.java new file mode 100644 index 0000000000000..982d8f1b98222 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.management.storagecache.v2020_03_01.ApiOperation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagecache.v2020_03_01.ApiOperationDisplay; + +class ApiOperationImpl extends WrapperImpl implements ApiOperation { + private final StorageCacheManager manager; + ApiOperationImpl(ApiOperationInner inner, StorageCacheManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageCacheManager manager() { + return this.manager; + } + + @Override + public ApiOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationInner.java new file mode 100644 index 0000000000000..df96adcf306c9 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ApiOperationInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.management.storagecache.v2020_03_01.ApiOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API operation description: see + * https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation. + */ +public class ApiOperationInner { + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private ApiOperationDisplay display; + + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public ApiOperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the ApiOperationInner object itself. + */ + public ApiOperationInner withDisplay(ApiOperationDisplay display) { + this.display = display; + return this; + } + + /** + * 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 ApiOperationInner object itself. + */ + public ApiOperationInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheImpl.java new file mode 100644 index 0000000000000..b415392202bcf --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.storagecache.v2020_03_01.Cache; +import rx.Observable; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheIdentity; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheHealth; +import java.util.List; +import com.microsoft.azure.management.storagecache.v2020_03_01.ProvisioningStateType; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheUpgradeStatus; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheNetworkSettings; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheEncryptionSettings; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheSecuritySettings; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheSku; + +class CacheImpl extends GroupableResourceCoreImpl implements Cache, Cache.Definition, Cache.Update { + CacheImpl(String name, CacheInner inner, StorageCacheManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + CachesInner client = this.manager().inner().caches(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CachesInner client = this.manager().inner().caches(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + CachesInner client = this.manager().inner().caches(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer cacheSizeGB() { + return this.inner().cacheSizeGB(); + } + + @Override + public CacheEncryptionSettings encryptionSettings() { + return this.inner().encryptionSettings(); + } + + @Override + public CacheHealth health() { + return this.inner().health(); + } + + @Override + public CacheIdentity identity() { + return this.inner().identity(); + } + + @Override + public List mountAddresses() { + return this.inner().mountAddresses(); + } + + @Override + public CacheNetworkSettings networkSettings() { + return this.inner().networkSettings(); + } + + @Override + public ProvisioningStateType provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public CacheSecuritySettings securitySettings() { + return this.inner().securitySettings(); + } + + @Override + public CacheSku sku() { + return this.inner().sku(); + } + + @Override + public String subnet() { + return this.inner().subnet(); + } + + @Override + public CacheUpgradeStatus upgradeStatus() { + return this.inner().upgradeStatus(); + } + + @Override + public CacheImpl withCacheSizeGB(Integer cacheSizeGB) { + this.inner().withCacheSizeGB(cacheSizeGB); + return this; + } + + @Override + public CacheImpl withEncryptionSettings(CacheEncryptionSettings encryptionSettings) { + this.inner().withEncryptionSettings(encryptionSettings); + return this; + } + + @Override + public CacheImpl withIdentity(CacheIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public CacheImpl withNetworkSettings(CacheNetworkSettings networkSettings) { + this.inner().withNetworkSettings(networkSettings); + return this; + } + + @Override + public CacheImpl withProvisioningState(ProvisioningStateType provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public CacheImpl withSecuritySettings(CacheSecuritySettings securitySettings) { + this.inner().withSecuritySettings(securitySettings); + return this; + } + + @Override + public CacheImpl withSku(CacheSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public CacheImpl withSubnet(String subnet) { + this.inner().withSubnet(subnet); + return this; + } + + @Override + public CacheImpl withUpgradeStatus(CacheUpgradeStatus upgradeStatus) { + this.inner().withUpgradeStatus(upgradeStatus); + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheInner.java new file mode 100644 index 0000000000000..7ab7b793b6d8c --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CacheInner.java @@ -0,0 +1,297 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheIdentity; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheHealth; +import java.util.List; +import com.microsoft.azure.management.storagecache.v2020_03_01.ProvisioningStateType; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheUpgradeStatus; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheNetworkSettings; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheEncryptionSettings; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheSecuritySettings; +import com.microsoft.azure.management.storagecache.v2020_03_01.CacheSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * A Cache instance. Follows Azure Resource Manager standards: + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md. + */ +@JsonFlatten +public class CacheInner extends Resource { + /** + * The identity of the cache, if configured. + */ + @JsonProperty(value = "identity") + private CacheIdentity identity; + + /** + * The size of this Cache, in GB. + */ + @JsonProperty(value = "properties.cacheSizeGB") + private Integer cacheSizeGB; + + /** + * Health of the Cache. + */ + @JsonProperty(value = "properties.health", access = JsonProperty.Access.WRITE_ONLY) + private CacheHealth health; + + /** + * Array of IP addresses that can be used by clients mounting this Cache. + */ + @JsonProperty(value = "properties.mountAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List mountAddresses; + + /** + * ARM provisioning state, see + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + * Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + * 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningStateType provisioningState; + + /** + * Subnet used for the Cache. + */ + @JsonProperty(value = "properties.subnet") + private String subnet; + + /** + * Upgrade status of the Cache. + */ + @JsonProperty(value = "properties.upgradeStatus") + private CacheUpgradeStatus upgradeStatus; + + /** + * Specifies network settings of the cache. + */ + @JsonProperty(value = "properties.networkSettings") + private CacheNetworkSettings networkSettings; + + /** + * Specifies encryption settings of the cache. + */ + @JsonProperty(value = "properties.encryptionSettings") + private CacheEncryptionSettings encryptionSettings; + + /** + * Specifies security settings of the cache. + */ + @JsonProperty(value = "properties.securitySettings") + private CacheSecuritySettings securitySettings; + + /** + * SKU for the Cache. + */ + @JsonProperty(value = "sku") + private CacheSku sku; + + /** + * Get the identity of the cache, if configured. + * + * @return the identity value + */ + public CacheIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the cache, if configured. + * + * @param identity the identity value to set + * @return the CacheInner object itself. + */ + public CacheInner withIdentity(CacheIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the size of this Cache, in GB. + * + * @return the cacheSizeGB value + */ + public Integer cacheSizeGB() { + return this.cacheSizeGB; + } + + /** + * Set the size of this Cache, in GB. + * + * @param cacheSizeGB the cacheSizeGB value to set + * @return the CacheInner object itself. + */ + public CacheInner withCacheSizeGB(Integer cacheSizeGB) { + this.cacheSizeGB = cacheSizeGB; + return this; + } + + /** + * Get health of the Cache. + * + * @return the health value + */ + public CacheHealth health() { + return this.health; + } + + /** + * Get array of IP addresses that can be used by clients mounting this Cache. + * + * @return the mountAddresses value + */ + public List mountAddresses() { + return this.mountAddresses; + } + + /** + * Get aRM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public ProvisioningStateType provisioningState() { + return this.provisioningState; + } + + /** + * Set aRM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating'. + * + * @param provisioningState the provisioningState value to set + * @return the CacheInner object itself. + */ + public CacheInner withProvisioningState(ProvisioningStateType provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get subnet used for the Cache. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set subnet used for the Cache. + * + * @param subnet the subnet value to set + * @return the CacheInner object itself. + */ + public CacheInner withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get upgrade status of the Cache. + * + * @return the upgradeStatus value + */ + public CacheUpgradeStatus upgradeStatus() { + return this.upgradeStatus; + } + + /** + * Set upgrade status of the Cache. + * + * @param upgradeStatus the upgradeStatus value to set + * @return the CacheInner object itself. + */ + public CacheInner withUpgradeStatus(CacheUpgradeStatus upgradeStatus) { + this.upgradeStatus = upgradeStatus; + return this; + } + + /** + * Get specifies network settings of the cache. + * + * @return the networkSettings value + */ + public CacheNetworkSettings networkSettings() { + return this.networkSettings; + } + + /** + * Set specifies network settings of the cache. + * + * @param networkSettings the networkSettings value to set + * @return the CacheInner object itself. + */ + public CacheInner withNetworkSettings(CacheNetworkSettings networkSettings) { + this.networkSettings = networkSettings; + return this; + } + + /** + * Get specifies encryption settings of the cache. + * + * @return the encryptionSettings value + */ + public CacheEncryptionSettings encryptionSettings() { + return this.encryptionSettings; + } + + /** + * Set specifies encryption settings of the cache. + * + * @param encryptionSettings the encryptionSettings value to set + * @return the CacheInner object itself. + */ + public CacheInner withEncryptionSettings(CacheEncryptionSettings encryptionSettings) { + this.encryptionSettings = encryptionSettings; + return this; + } + + /** + * Get specifies security settings of the cache. + * + * @return the securitySettings value + */ + public CacheSecuritySettings securitySettings() { + return this.securitySettings; + } + + /** + * Set specifies security settings of the cache. + * + * @param securitySettings the securitySettings value to set + * @return the CacheInner object itself. + */ + public CacheInner withSecuritySettings(CacheSecuritySettings securitySettings) { + this.securitySettings = securitySettings; + return this; + } + + /** + * Get sKU for the Cache. + * + * @return the sku value + */ + public CacheSku sku() { + return this.sku; + } + + /** + * Set sKU for the Cache. + * + * @param sku the sku value to set + * @return the CacheInner object itself. + */ + public CacheInner withSku(CacheSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesImpl.java new file mode 100644 index 0000000000000..7ffebffe11974 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.storagecache.v2020_03_01.Caches; +import com.microsoft.azure.management.storagecache.v2020_03_01.Cache; +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 CachesImpl extends GroupableResourcesCoreImpl implements Caches { + protected CachesImpl(StorageCacheManager manager) { + super(manager.inner().caches(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + CachesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + CachesInner 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) { + CachesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + CachesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cache call(CacheInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + CachesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + CachesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cache call(CacheInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public CacheImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable flushAsync(String resourceGroupName, String cacheName) { + CachesInner client = this.inner(); + return client.flushAsync(resourceGroupName, cacheName) + ;} + + @Override + public Observable startAsync(String resourceGroupName, String cacheName) { + CachesInner client = this.inner(); + return client.startAsync(resourceGroupName, cacheName) + ;} + + @Override + public Observable stopAsync(String resourceGroupName, String cacheName) { + CachesInner client = this.inner(); + return client.stopAsync(resourceGroupName, cacheName) + ;} + + @Override + public Observable upgradeFirmwareAsync(String resourceGroupName, String cacheName) { + CachesInner client = this.inner(); + return client.upgradeFirmwareAsync(resourceGroupName, cacheName) + ;} + + @Override + protected CacheImpl wrapModel(CacheInner inner) { + return new CacheImpl(inner.name(), inner, manager()); + } + + @Override + protected CacheImpl wrapModel(String name) { + return new CacheImpl(name, new CacheInner(), this.manager()); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesInner.java new file mode 100644 index 0000000000000..90b816a96b90f --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/CachesInner.java @@ -0,0 +1,1946 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in Caches. + */ +public class CachesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private CachesService service; + /** The service client containing this operation class. */ + private StorageCacheManagementClientImpl client; + + /** + * Initializes an instance of CachesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CachesInner(Retrofit retrofit, StorageCacheManagementClientImpl client) { + this.service = retrofit.create(CachesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Caches to be + * used by Retrofit to perform actually REST calls. + */ + interface CachesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Caches list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/caches") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Caches listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Caches delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Caches beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Caches getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("cacheName") String cacheName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Caches createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Query("api-version") String apiVersion, @Body CacheInner cache, @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.storagecache.v2020_03_01.Caches beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Query("api-version") String apiVersion, @Body CacheInner cache, @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.storagecache.v2020_03_01.Caches update" }) + @PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Query("api-version") String apiVersion, @Body CacheInner cache, @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.storagecache.v2020_03_01.Caches flush" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush") + Observable> flush(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches beginFlush" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush") + Observable> beginFlush(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches start" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches beginStart" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches stop" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches beginStop" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches upgradeFirmware" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade") + Observable> upgradeFirmware(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches beginUpgradeFirmware" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade") + Observable> beginUpgradeFirmware(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.Caches listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.storagecache.v2020_03_01.Caches listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CacheInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CacheInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param resourceGroupName Target resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CacheInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param resourceGroupName Target resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param resourceGroupName Target resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param resourceGroupName Target resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + ServiceResponse> * @param resourceGroupName Target resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CacheInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } 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); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object delete(String resourceGroupName, String cacheName) { + return deleteWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().last().body(); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String cacheName) { + return deleteWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, cacheName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object beginDelete(String resourceGroupName, String cacheName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginDeleteAsync(String resourceGroupName, String cacheName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Schedules a Cache for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, cacheName, this.client.subscriptionId(), 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); + } + + /** + * Returns a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 CacheInner object if successful. + */ + public CacheInner getByResourceGroup(String resourceGroupName, String cacheName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Returns a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Returns a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String cacheName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, CacheInner>() { + @Override + public CacheInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, cacheName, this.client.subscriptionId(), 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 Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 CacheInner object if successful. + */ + public CacheInner createOrUpdate(String resourceGroupName, String cacheName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().last().body(); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String cacheName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, CacheInner>() { + @Override + public CacheInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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 CacheInner cache = null; + Observable> observable = service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), cache, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @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 CacheInner object if successful. + */ + public CacheInner createOrUpdate(String resourceGroupName, String cacheName, CacheInner cache) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, cache).toBlocking().last().body(); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @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 cacheName, CacheInner cache, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, cache), serviceCallback); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String cacheName, CacheInner cache) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, cache).map(new Func1, CacheInner>() { + @Override + public CacheInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName, CacheInner cache) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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(cache); + Observable> observable = service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), cache, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 CacheInner object if successful. + */ + public CacheInner beginCreateOrUpdate(String resourceGroupName, String cacheName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String cacheName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, CacheInner>() { + @Override + public CacheInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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 CacheInner cache = null; + return service.beginCreateOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), cache, 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); + } + } + }); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @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 CacheInner object if successful. + */ + public CacheInner beginCreateOrUpdate(String resourceGroupName, String cacheName, CacheInner cache) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, cache).toBlocking().single().body(); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @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 cacheName, CacheInner cache, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, cache), serviceCallback); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String cacheName, CacheInner cache) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, cache).map(new Func1, CacheInner>() { + @Override + public CacheInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the new Cache. If read-only properties are included, they must match the existing values of those properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName, CacheInner cache) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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(cache); + return service.beginCreateOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), cache, 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()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 CacheInner object if successful. + */ + public CacheInner update(String resourceGroupName, String cacheName) { + return updateWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable updateAsync(String resourceGroupName, String cacheName) { + return updateWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, CacheInner>() { + @Override + public CacheInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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 CacheInner cache = null; + return service.update(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), cache, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the Cache. If read-only properties are included, they must match the existing values of those properties. + * @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 CacheInner object if successful. + */ + public CacheInner update(String resourceGroupName, String cacheName, CacheInner cache) { + return updateWithServiceResponseAsync(resourceGroupName, cacheName, cache).toBlocking().single().body(); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the Cache. If read-only properties are included, they must match the existing values of those properties. + * @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 cacheName, CacheInner cache, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, cacheName, cache), serviceCallback); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the Cache. If read-only properties are included, they must match the existing values of those properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable updateAsync(String resourceGroupName, String cacheName, CacheInner cache) { + return updateWithServiceResponseAsync(resourceGroupName, cacheName, cache).map(new Func1, CacheInner>() { + @Override + public CacheInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Cache instance. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param cache Object containing the user-selectable properties of the Cache. If read-only properties are included, they must match the existing values of those properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CacheInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String cacheName, CacheInner cache) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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(cache); + return service.update(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), cache, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object flush(String resourceGroupName, String cacheName) { + return flushWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().last().body(); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 flushAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(flushWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable flushAsync(String resourceGroupName, String cacheName) { + return flushWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> flushWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.flush(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object beginFlush(String resourceGroupName, String cacheName) { + return beginFlushWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 beginFlushAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginFlushWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginFlushAsync(String resourceGroupName, String cacheName) { + return beginFlushWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Tells a Cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginFlushWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.beginFlush(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginFlushDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginFlushDelegate(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); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object start(String resourceGroupName, String cacheName) { + return startWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().last().body(); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 startAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String cacheName) { + return startWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.start(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object beginStart(String resourceGroupName, String cacheName) { + return beginStartWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 beginStartAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginStartAsync(String resourceGroupName, String cacheName) { + return beginStartWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Tells a Stopped state Cache to transition to Active state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.beginStart(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(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); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object stop(String resourceGroupName, String cacheName) { + return stopWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().last().body(); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 stopAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String cacheName) { + return stopWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.stop(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object beginStop(String resourceGroupName, String cacheName) { + return beginStopWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 beginStopAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginStopAsync(String resourceGroupName, String cacheName) { + return beginStopWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Tells an Active Cache to transition to Stopped state. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.beginStop(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(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); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object upgradeFirmware(String resourceGroupName, String cacheName) { + return upgradeFirmwareWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().last().body(); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 upgradeFirmwareAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(upgradeFirmwareWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable upgradeFirmwareAsync(String resourceGroupName, String cacheName) { + return upgradeFirmwareWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> upgradeFirmwareWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.upgradeFirmware(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.AZURE_ASYNC_OPERATION), new TypeToken() { }.getType()); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 Object object if successful. + */ + public Object beginUpgradeFirmware(String resourceGroupName, String cacheName) { + return beginUpgradeFirmwareWithServiceResponseAsync(resourceGroupName, cacheName).toBlocking().single().body(); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 beginUpgradeFirmwareAsync(String resourceGroupName, String cacheName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpgradeFirmwareWithServiceResponseAsync(resourceGroupName, cacheName), serviceCallback); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginUpgradeFirmwareAsync(String resourceGroupName, String cacheName) { + return beginUpgradeFirmwareWithServiceResponseAsync(resourceGroupName, cacheName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginUpgradeFirmwareWithServiceResponseAsync(String resourceGroupName, String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.beginUpgradeFirmware(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpgradeFirmwareDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpgradeFirmwareDelegate(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()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CacheInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Caches the user has access to under a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Caches the user has access to under a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CacheInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CacheInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CacheInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Caches the user has access to under a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CacheInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(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/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/IdParsingUtils.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..9d4a84fc2e9fc --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/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.storagecache.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/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/OperationsImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..1baa887fa25c8 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/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.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagecache.v2020_03_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storagecache.v2020_03_01.ApiOperation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final StorageCacheManager manager; + + OperationsImpl(StorageCacheManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public StorageCacheManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApiOperation call(ApiOperationInner inner) { + return new ApiOperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/OperationsInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..ca28984181e7f --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/OperationsInner.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.storagecache.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private StorageCacheManagementClientImpl 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, StorageCacheManagementClientImpl 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.storagecache.v2020_03_01.Operations list" }) + @GET("providers/Microsoft.StorageCache/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApiOperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Resource Provider operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiOperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiOperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApiOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApiOperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiOperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApiOperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Resource Provider operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApiOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/PageImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..28709d43377d0 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/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.storagecache.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("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuImpl.java new file mode 100644 index 0000000000000..f00fa02411e44 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.management.storagecache.v2020_03_01.ResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storagecache.v2020_03_01.ResourceSkuCapabilities; +import com.microsoft.azure.management.storagecache.v2020_03_01.ResourceSkuLocationInfo; +import com.microsoft.azure.management.storagecache.v2020_03_01.Restriction; + +class ResourceSkuImpl extends WrapperImpl implements ResourceSku { + private final StorageCacheManager manager; + + ResourceSkuImpl(ResourceSkuInner inner, StorageCacheManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageCacheManager manager() { + return this.manager; + } + + + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public List locationInfo() { + return this.inner().locationInfo(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuInner.java new file mode 100644 index 0000000000000..4b51a78273490 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/ResourceSkuInner.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.storagecache.v2020_03_01.ResourceSkuCapabilities; +import com.microsoft.azure.management.storagecache.v2020_03_01.ResourceSkuLocationInfo; +import com.microsoft.azure.management.storagecache.v2020_03_01.Restriction; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource SKU. + */ +public class ResourceSkuInner { + /** + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * A list of capabilities of this SKU, such as throughput or ops/sec. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** + * The set of locations that the SKU is available. This will be supported + * and registered Azure Geo Regions (e.g., West US, East US, Southeast + * Asia, etc.). + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locationInfo") + private List locationInfo; + + /** + * The name of this SKU. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The restrictions preventing this SKU from being used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get the type of resource the SKU applies to. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get a list of capabilities of this SKU, such as throughput or ops/sec. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set a list of capabilities of this SKU, such as throughput or ops/sec. + * + * @param capabilities the capabilities value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g., West US, East US, Southeast Asia, etc.). + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locationInfo value + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Set the set of locations that the SKU is available. + * + * @param locationInfo the locationInfo value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withLocationInfo(List locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get the name of this SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of this SKU. + * + * @param name the name value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the restrictions preventing this SKU from being used. This is empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions preventing this SKU from being used. This is empty if there are no restrictions. + * + * @param restrictions the restrictions value to set + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusImpl.java new file mode 100644 index 0000000000000..6d1104c4a2415 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagecache.v2020_03_01.Skus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.storagecache.v2020_03_01.ResourceSku; + +class SkusImpl extends WrapperImpl implements Skus { + private PagedListConverter converter; + private final StorageCacheManager manager; + + SkusImpl(StorageCacheManager manager) { + super(manager.inner().skus()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(ResourceSkuInner inner) { + return Observable.just((ResourceSku) wrapModel(inner)); + } + }; + } + + public StorageCacheManager manager() { + return this.manager; + } + + private ResourceSkuImpl wrapModel(ResourceSkuInner inner) { + return new ResourceSkuImpl(inner, manager()); + } + + @Override + public PagedList list() { + SkusInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + SkusInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ResourceSku call(ResourceSkuInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusInner.java new file mode 100644 index 0000000000000..49537d2b7a8f3 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/SkusInner.java @@ -0,0 +1,287 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Skus. + */ +public class SkusInner { + /** The Retrofit service to perform REST calls. */ + private SkusService service; + /** The service client containing this operation class. */ + private StorageCacheManagementClientImpl client; + + /** + * Initializes an instance of SkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkusInner(Retrofit retrofit, StorageCacheManagementClientImpl client) { + this.service = retrofit.create(SkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for Skus to be + * used by Retrofit to perform actually REST calls. + */ + interface SkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Skus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.Skus listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceSkuInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceSkuInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of StorageCache.Cache SKUs available to this subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceSkuInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManagementClientImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManagementClientImpl.java new file mode 100644 index 0000000000000..312eac834bcb6 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManagementClientImpl.java @@ -0,0 +1,254 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the StorageCacheManagementClientImpl class. + */ +public class StorageCacheManagementClientImpl 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 StorageCacheManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 StorageCacheManagementClientImpl 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 StorageCacheManagementClientImpl 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 StorageCacheManagementClientImpl 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 SkusInner object to access its operations. + */ + private SkusInner skus; + + /** + * Gets the SkusInner object to access its operations. + * @return the SkusInner object. + */ + public SkusInner skus() { + return this.skus; + } + + /** + * The UsageModelsInner object to access its operations. + */ + private UsageModelsInner usageModels; + + /** + * Gets the UsageModelsInner object to access its operations. + * @return the UsageModelsInner object. + */ + public UsageModelsInner usageModels() { + return this.usageModels; + } + + /** + * The CachesInner object to access its operations. + */ + private CachesInner caches; + + /** + * Gets the CachesInner object to access its operations. + * @return the CachesInner object. + */ + public CachesInner caches() { + return this.caches; + } + + /** + * The StorageTargetsInner object to access its operations. + */ + private StorageTargetsInner storageTargets; + + /** + * Gets the StorageTargetsInner object to access its operations. + * @return the StorageTargetsInner object. + */ + public StorageTargetsInner storageTargets() { + return this.storageTargets; + } + + /** + * Initializes an instance of StorageCacheManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public StorageCacheManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of StorageCacheManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public StorageCacheManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of StorageCacheManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public StorageCacheManagementClientImpl(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.skus = new SkusInner(restClient().retrofit(), this); + this.usageModels = new UsageModelsInner(restClient().retrofit(), this); + this.caches = new CachesInner(restClient().retrofit(), this); + this.storageTargets = new StorageTargetsInner(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(), "StorageCacheManagementClient", "2020-03-01"); + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManager.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManager.java new file mode 100644 index 0000000000000..a858616824536 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageCacheManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.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.storagecache.v2020_03_01.Operations; +import com.microsoft.azure.management.storagecache.v2020_03_01.Skus; +import com.microsoft.azure.management.storagecache.v2020_03_01.UsageModels; +import com.microsoft.azure.management.storagecache.v2020_03_01.Caches; +import com.microsoft.azure.management.storagecache.v2020_03_01.StorageTargets; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure StorageCache resource management. + */ +public final class StorageCacheManager extends ManagerCore { + private Operations operations; + private Skus skus; + private UsageModels usageModels; + private Caches caches; + private StorageTargets storageTargets; + /** + * Get a Configurable instance that can be used to create StorageCacheManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new StorageCacheManager.ConfigurableImpl(); + } + /** + * Creates an instance of StorageCacheManager that exposes StorageCache resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the StorageCacheManager + */ + public static StorageCacheManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new StorageCacheManager(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 StorageCacheManager that exposes StorageCache resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the StorageCacheManager + */ + public static StorageCacheManager authenticate(RestClient restClient, String subscriptionId) { + return new StorageCacheManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of StorageCacheManager that exposes StorageCache management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing StorageCache management API entry points that work across subscriptions + */ + StorageCacheManager 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 Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(this); + } + return this.skus; + } + + /** + * @return Entry point to manage UsageModels. + */ + public UsageModels usageModels() { + if (this.usageModels == null) { + this.usageModels = new UsageModelsImpl(this); + } + return this.usageModels; + } + + /** + * @return Entry point to manage Caches. + */ + public Caches caches() { + if (this.caches == null) { + this.caches = new CachesImpl(this); + } + return this.caches; + } + + /** + * @return Entry point to manage StorageTargets. + */ + public StorageTargets storageTargets() { + if (this.storageTargets == null) { + this.storageTargets = new StorageTargetsImpl(this); + } + return this.storageTargets; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public StorageCacheManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return StorageCacheManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private StorageCacheManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new StorageCacheManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetImpl.java new file mode 100644 index 0000000000000..853de5825b8cd --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.management.storagecache.v2020_03_01.StorageTarget; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storagecache.v2020_03_01.NamespaceJunction; +import com.microsoft.azure.management.storagecache.v2020_03_01.ProvisioningStateType; +import com.microsoft.azure.management.storagecache.v2020_03_01.Nfs3Target; +import com.microsoft.azure.management.storagecache.v2020_03_01.ClfsTarget; +import com.microsoft.azure.management.storagecache.v2020_03_01.UnknownTarget; + +class StorageTargetImpl extends CreatableUpdatableImpl implements StorageTarget, StorageTarget.Definition, StorageTarget.Update { + private final StorageCacheManager manager; + private String resourceGroupName; + private String cacheName; + private String storageTargetName; + + StorageTargetImpl(String name, StorageCacheManager manager) { + super(name, new StorageTargetInner()); + this.manager = manager; + // Set resource name + this.storageTargetName = name; + // + } + + StorageTargetImpl(StorageTargetInner inner, StorageCacheManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.storageTargetName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.cacheName = IdParsingUtils.getValueFromIdByName(inner.id(), "caches"); + this.storageTargetName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageTargets"); + // + } + + @Override + public StorageCacheManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StorageTargetsInner client = this.manager().inner().storageTargets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.cacheName, this.storageTargetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageTargetsInner client = this.manager().inner().storageTargets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.cacheName, this.storageTargetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageTargetsInner client = this.manager().inner().storageTargets(); + return client.getAsync(this.resourceGroupName, this.cacheName, this.storageTargetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public ClfsTarget clfs() { + return this.inner().clfs(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List junctions() { + return this.inner().junctions(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Nfs3Target nfs3() { + return this.inner().nfs3(); + } + + @Override + public ProvisioningStateType provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String targetType() { + return this.inner().targetType(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public UnknownTarget unknown() { + return this.inner().unknown(); + } + + @Override + public StorageTargetImpl withExistingCach(String resourceGroupName, String cacheName) { + this.resourceGroupName = resourceGroupName; + this.cacheName = cacheName; + return this; + } + + @Override + public StorageTargetImpl withClfs(ClfsTarget clfs) { + this.inner().withClfs(clfs); + return this; + } + + @Override + public StorageTargetImpl withJunctions(List junctions) { + this.inner().withJunctions(junctions); + return this; + } + + @Override + public StorageTargetImpl withNfs3(Nfs3Target nfs3) { + this.inner().withNfs3(nfs3); + return this; + } + + @Override + public StorageTargetImpl withProvisioningState(ProvisioningStateType provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public StorageTargetImpl withTargetType(String targetType) { + this.inner().withTargetType(targetType); + return this; + } + + @Override + public StorageTargetImpl withUnknown(UnknownTarget unknown) { + this.inner().withUnknown(unknown); + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetInner.java new file mode 100644 index 0000000000000..6f021b32008c9 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetInner.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.storagecache.v2020_03_01.NamespaceJunction; +import com.microsoft.azure.management.storagecache.v2020_03_01.ProvisioningStateType; +import com.microsoft.azure.management.storagecache.v2020_03_01.Nfs3Target; +import com.microsoft.azure.management.storagecache.v2020_03_01.ClfsTarget; +import com.microsoft.azure.management.storagecache.v2020_03_01.UnknownTarget; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storagecache.v2020_03_01.StorageTargetResource; + +/** + * Type of the Storage Target. + */ +@JsonFlatten +public class StorageTargetInner extends StorageTargetResource { + /** + * List of Cache namespace junctions to target for namespace associations. + */ + @JsonProperty(value = "properties.junctions") + private List junctions; + + /** + * Type of the Storage Target. + */ + @JsonProperty(value = "properties.targetType") + private String targetType; + + /** + * ARM provisioning state, see + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. + * Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', + * 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningStateType provisioningState; + + /** + * Properties when targetType is nfs3. + */ + @JsonProperty(value = "properties.nfs3") + private Nfs3Target nfs3; + + /** + * Properties when targetType is clfs. + */ + @JsonProperty(value = "properties.clfs") + private ClfsTarget clfs; + + /** + * Properties when targetType is unknown. + */ + @JsonProperty(value = "properties.unknown") + private UnknownTarget unknown; + + /** + * Get list of Cache namespace junctions to target for namespace associations. + * + * @return the junctions value + */ + public List junctions() { + return this.junctions; + } + + /** + * Set list of Cache namespace junctions to target for namespace associations. + * + * @param junctions the junctions value to set + * @return the StorageTargetInner object itself. + */ + public StorageTargetInner withJunctions(List junctions) { + this.junctions = junctions; + return this; + } + + /** + * Get type of the Storage Target. + * + * @return the targetType value + */ + public String targetType() { + return this.targetType; + } + + /** + * Set type of the Storage Target. + * + * @param targetType the targetType value to set + * @return the StorageTargetInner object itself. + */ + public StorageTargetInner withTargetType(String targetType) { + this.targetType = targetType; + return this; + } + + /** + * Get aRM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public ProvisioningStateType provisioningState() { + return this.provisioningState; + } + + /** + * Set aRM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating'. + * + * @param provisioningState the provisioningState value to set + * @return the StorageTargetInner object itself. + */ + public StorageTargetInner withProvisioningState(ProvisioningStateType provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get properties when targetType is nfs3. + * + * @return the nfs3 value + */ + public Nfs3Target nfs3() { + return this.nfs3; + } + + /** + * Set properties when targetType is nfs3. + * + * @param nfs3 the nfs3 value to set + * @return the StorageTargetInner object itself. + */ + public StorageTargetInner withNfs3(Nfs3Target nfs3) { + this.nfs3 = nfs3; + return this; + } + + /** + * Get properties when targetType is clfs. + * + * @return the clfs value + */ + public ClfsTarget clfs() { + return this.clfs; + } + + /** + * Set properties when targetType is clfs. + * + * @param clfs the clfs value to set + * @return the StorageTargetInner object itself. + */ + public StorageTargetInner withClfs(ClfsTarget clfs) { + this.clfs = clfs; + return this; + } + + /** + * Get properties when targetType is unknown. + * + * @return the unknown value + */ + public UnknownTarget unknown() { + return this.unknown; + } + + /** + * Set properties when targetType is unknown. + * + * @param unknown the unknown value to set + * @return the StorageTargetInner object itself. + */ + public StorageTargetInner withUnknown(UnknownTarget unknown) { + this.unknown = unknown; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsImpl.java new file mode 100644 index 0000000000000..2297acc37adcf --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsImpl.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.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagecache.v2020_03_01.StorageTargets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storagecache.v2020_03_01.StorageTarget; + +class StorageTargetsImpl extends WrapperImpl implements StorageTargets { + private final StorageCacheManager manager; + + StorageTargetsImpl(StorageCacheManager manager) { + super(manager.inner().storageTargets()); + this.manager = manager; + } + + public StorageCacheManager manager() { + return this.manager; + } + + @Override + public StorageTargetImpl define(String name) { + return wrapModel(name); + } + + private StorageTargetImpl wrapModel(StorageTargetInner inner) { + return new StorageTargetImpl(inner, manager()); + } + + private StorageTargetImpl wrapModel(String name) { + return new StorageTargetImpl(name, this.manager()); + } + + @Override + public Observable listByCacheAsync(final String resourceGroupName, final String cacheName) { + StorageTargetsInner client = this.inner(); + return client.listByCacheAsync(resourceGroupName, cacheName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageTarget call(StorageTargetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String cacheName, String storageTargetName) { + StorageTargetsInner client = this.inner(); + return client.getAsync(resourceGroupName, cacheName, storageTargetName) + .flatMap(new Func1>() { + @Override + public Observable call(StorageTargetInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((StorageTarget)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String cacheName, String storageTargetName) { + StorageTargetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, cacheName, storageTargetName).toCompletable(); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsInner.java new file mode 100644 index 0000000000000..e5cb985efc33d --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/StorageTargetsInner.java @@ -0,0 +1,935 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageTargets. + */ +public class StorageTargetsInner { + /** The Retrofit service to perform REST calls. */ + private StorageTargetsService service; + /** The service client containing this operation class. */ + private StorageCacheManagementClientImpl client; + + /** + * Initializes an instance of StorageTargetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageTargetsInner(Retrofit retrofit, StorageCacheManagementClientImpl client) { + this.service = retrofit.create(StorageTargetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageTargets to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageTargetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.StorageTargets listByCache" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets") + Observable> listByCache(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @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.storagecache.v2020_03_01.StorageTargets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Path("storageTargetName") String storageTargetName, @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.storagecache.v2020_03_01.StorageTargets beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Path("storageTargetName") String storageTargetName, @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.storagecache.v2020_03_01.StorageTargets get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Path("storageTargetName") String storageTargetName, @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.storagecache.v2020_03_01.StorageTargets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Path("storageTargetName") String storageTargetName, @Query("api-version") String apiVersion, @Body StorageTargetInner storagetarget, @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.storagecache.v2020_03_01.StorageTargets beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("cacheName") String cacheName, @Path("storageTargetName") String storageTargetName, @Query("api-version") String apiVersion, @Body StorageTargetInner storagetarget, @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.storagecache.v2020_03_01.StorageTargets listByCacheNext" }) + @GET + Observable> listByCacheNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageTargetInner> object if successful. + */ + public PagedList listByCache(final String resourceGroupName, final String cacheName) { + ServiceResponse> response = listByCacheSinglePageAsync(resourceGroupName, cacheName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByCacheNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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> listByCacheAsync(final String resourceGroupName, final String cacheName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByCacheSinglePageAsync(resourceGroupName, cacheName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByCacheNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageTargetInner> object + */ + public Observable> listByCacheAsync(final String resourceGroupName, final String cacheName) { + return listByCacheWithServiceResponseAsync(resourceGroupName, cacheName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageTargetInner> object + */ + public Observable>> listByCacheWithServiceResponseAsync(final String resourceGroupName, final String cacheName) { + return listByCacheSinglePageAsync(resourceGroupName, cacheName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByCacheNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + ServiceResponse> * @param resourceGroupName Target resource group. + ServiceResponse> * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageTargetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByCacheSinglePageAsync(final String resourceGroupName, final String cacheName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName 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.listByCache(resourceGroupName, this.client.subscriptionId(), cacheName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByCacheDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByCacheDelegate(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); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage 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 Object object if successful. + */ + public Object delete(String resourceGroupName, String cacheName, String storageTargetName) { + return deleteWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).toBlocking().last().body(); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage 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 cacheName, String storageTargetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName), serviceCallback); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String cacheName, String storageTargetName) { + return deleteWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String cacheName, String storageTargetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (storageTargetName == null) { + throw new IllegalArgumentException("Parameter storageTargetName 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(resourceGroupName, this.client.subscriptionId(), cacheName, storageTargetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage 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 Object object if successful. + */ + public Object beginDelete(String resourceGroupName, String cacheName, String storageTargetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).toBlocking().single().body(); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage 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 cacheName, String storageTargetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName), serviceCallback); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginDeleteAsync(String resourceGroupName, String cacheName, String storageTargetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Removes a Storage Target from a Cache. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the Cache is healthy again. Note that if the Cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String cacheName, String storageTargetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (storageTargetName == null) { + throw new IllegalArgumentException("Parameter storageTargetName 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(resourceGroupName, this.client.subscriptionId(), cacheName, storageTargetName, 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); + } + + /** + * Returns a Storage Target from a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 StorageTargetInner object if successful. + */ + public StorageTargetInner get(String resourceGroupName, String cacheName, String storageTargetName) { + return getWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).toBlocking().single().body(); + } + + /** + * Returns a Storage Target from a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, String storageTargetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName), serviceCallback); + } + + /** + * Returns a Storage Target from a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageTargetInner object + */ + public Observable getAsync(String resourceGroupName, String cacheName, String storageTargetName) { + return getWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).map(new Func1, StorageTargetInner>() { + @Override + public StorageTargetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a Storage Target from a Cache. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageTargetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String cacheName, String storageTargetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (storageTargetName == null) { + throw new IllegalArgumentException("Parameter storageTargetName 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(resourceGroupName, this.client.subscriptionId(), cacheName, storageTargetName, 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 Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 StorageTargetInner object if successful. + */ + public StorageTargetInner createOrUpdate(String resourceGroupName, String cacheName, String storageTargetName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).toBlocking().last().body(); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, String storageTargetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName), serviceCallback); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String cacheName, String storageTargetName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).map(new Func1, StorageTargetInner>() { + @Override + public StorageTargetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName, String storageTargetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (storageTargetName == null) { + throw new IllegalArgumentException("Parameter storageTargetName 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 StorageTargetInner storagetarget = null; + Observable> observable = service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, storageTargetName, this.client.apiVersion(), storagetarget, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage 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 StorageTargetInner object if successful. + */ + public StorageTargetInner createOrUpdate(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName, storagetarget).toBlocking().last().body(); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage 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 createOrUpdateAsync(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName, storagetarget), serviceCallback); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName, storagetarget).map(new Func1, StorageTargetInner>() { + @Override + public StorageTargetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (storageTargetName == null) { + throw new IllegalArgumentException("Parameter storageTargetName 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(storagetarget); + Observable> observable = service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, storageTargetName, this.client.apiVersion(), storagetarget, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 StorageTargetInner object if successful. + */ + public StorageTargetInner beginCreateOrUpdate(String resourceGroupName, String cacheName, String storageTargetName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).toBlocking().single().body(); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @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 cacheName, String storageTargetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName), serviceCallback); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageTargetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String cacheName, String storageTargetName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName).map(new Func1, StorageTargetInner>() { + @Override + public StorageTargetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageTargetInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName, String storageTargetName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (storageTargetName == null) { + throw new IllegalArgumentException("Parameter storageTargetName 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 StorageTargetInner storagetarget = null; + return service.beginCreateOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, storageTargetName, this.client.apiVersion(), storagetarget, 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); + } + } + }); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage 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 StorageTargetInner object if successful. + */ + public StorageTargetInner beginCreateOrUpdate(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName, storagetarget).toBlocking().single().body(); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage 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 beginCreateOrUpdateAsync(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName, storagetarget), serviceCallback); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageTargetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, cacheName, storageTargetName, storagetarget).map(new Func1, StorageTargetInner>() { + @Override + public StorageTargetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Storage Target. This operation is allowed at any time, but if the Cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of the Storage Target. Length of name must be not greater than 80 and chars must be in list of [-0-9a-zA-Z_] char class. + * @param storagetarget Object containing the definition of a Storage Target. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageTargetInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String cacheName, String storageTargetName, StorageTargetInner storagetarget) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (cacheName == null) { + throw new IllegalArgumentException("Parameter cacheName is required and cannot be null."); + } + if (storageTargetName == null) { + throw new IllegalArgumentException("Parameter storageTargetName 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(storagetarget); + return service.beginCreateOrUpdate(resourceGroupName, this.client.subscriptionId(), cacheName, storageTargetName, this.client.apiVersion(), storagetarget, 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()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageTargetInner> object if successful. + */ + public PagedList listByCacheNext(final String nextPageLink) { + ServiceResponse> response = listByCacheNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByCacheNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByCacheNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByCacheNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByCacheNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageTargetInner> object + */ + public Observable> listByCacheNextAsync(final String nextPageLink) { + return listByCacheNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageTargetInner> object + */ + public Observable>> listByCacheNextWithServiceResponseAsync(final String nextPageLink) { + return listByCacheNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByCacheNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns a list of Storage Targets for the specified Cache. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageTargetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByCacheNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByCacheNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByCacheNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByCacheNextDelegate(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/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelImpl.java new file mode 100644 index 0000000000000..6bd3df7f30483 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelImpl.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.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.management.storagecache.v2020_03_01.UsageModel; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.storagecache.v2020_03_01.UsageModelDisplay; + +class UsageModelImpl extends WrapperImpl implements UsageModel { + private final StorageCacheManager manager; + + UsageModelImpl(UsageModelInner inner, StorageCacheManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageCacheManager manager() { + return this.manager; + } + + + + @Override + public UsageModelDisplay display() { + return this.inner().display(); + } + + @Override + public String modelName() { + return this.inner().modelName(); + } + + @Override + public String targetType() { + return this.inner().targetType(); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelInner.java new file mode 100644 index 0000000000000..a4d2ce95403d2 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.management.storagecache.v2020_03_01.UsageModelDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A usage model. + */ +public class UsageModelInner { + /** + * Localized information describing this usage model. + */ + @JsonProperty(value = "display") + private UsageModelDisplay display; + + /** + * Non-localized keyword name for this usage model. + */ + @JsonProperty(value = "modelName") + private String modelName; + + /** + * The type of Storage Target to which this model is applicable (only nfs3 + * as of this version). + */ + @JsonProperty(value = "targetType") + private String targetType; + + /** + * Get localized information describing this usage model. + * + * @return the display value + */ + public UsageModelDisplay display() { + return this.display; + } + + /** + * Set localized information describing this usage model. + * + * @param display the display value to set + * @return the UsageModelInner object itself. + */ + public UsageModelInner withDisplay(UsageModelDisplay display) { + this.display = display; + return this; + } + + /** + * Get non-localized keyword name for this usage model. + * + * @return the modelName value + */ + public String modelName() { + return this.modelName; + } + + /** + * Set non-localized keyword name for this usage model. + * + * @param modelName the modelName value to set + * @return the UsageModelInner object itself. + */ + public UsageModelInner withModelName(String modelName) { + this.modelName = modelName; + return this; + } + + /** + * Get the type of Storage Target to which this model is applicable (only nfs3 as of this version). + * + * @return the targetType value + */ + public String targetType() { + return this.targetType; + } + + /** + * Set the type of Storage Target to which this model is applicable (only nfs3 as of this version). + * + * @param targetType the targetType value to set + * @return the UsageModelInner object itself. + */ + public UsageModelInner withTargetType(String targetType) { + this.targetType = targetType; + return this; + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsImpl.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsImpl.java new file mode 100644 index 0000000000000..0147e9c53dd45 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storagecache.v2020_03_01.UsageModels; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.storagecache.v2020_03_01.UsageModel; + +class UsageModelsImpl extends WrapperImpl implements UsageModels { + private PagedListConverter converter; + private final StorageCacheManager manager; + + UsageModelsImpl(StorageCacheManager manager) { + super(manager.inner().usageModels()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(UsageModelInner inner) { + return Observable.just((UsageModel) wrapModel(inner)); + } + }; + } + + public StorageCacheManager manager() { + return this.manager; + } + + private UsageModelImpl wrapModel(UsageModelInner inner) { + return new UsageModelImpl(inner, manager()); + } + + @Override + public PagedList list() { + UsageModelsInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + UsageModelsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public UsageModel call(UsageModelInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsInner.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsInner.java new file mode 100644 index 0000000000000..dc59c018675cd --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/UsageModelsInner.java @@ -0,0 +1,287 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.storagecache.v2020_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in UsageModels. + */ +public class UsageModelsInner { + /** The Retrofit service to perform REST calls. */ + private UsageModelsService service; + /** The service client containing this operation class. */ + private StorageCacheManagementClientImpl client; + + /** + * Initializes an instance of UsageModelsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsageModelsInner(Retrofit retrofit, StorageCacheManagementClientImpl client) { + this.service = retrofit.create(UsageModelsService.class); + this.client = client; + } + + /** + * The interface defining all the services for UsageModels to be + * used by Retrofit to perform actually REST calls. + */ + interface UsageModelsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.UsageModels list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/usageModels") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storagecache.v2020_03_01.UsageModels listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageModelInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageModelInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageModelInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageModelInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UsageModelInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageModelInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageModelInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of Cache Usage Models available to this subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageModelInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/package-info.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/implementation/package-info.java new file mode 100644 index 0000000000000..364e06b5dc985 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/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 StorageCacheManagementClient. + * A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. + */ +package com.microsoft.azure.management.storagecache.v2020_03_01.implementation; diff --git a/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/package-info.java b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/v2020_03_01/package-info.java new file mode 100644 index 0000000000000..4e4874d323048 --- /dev/null +++ b/sdk/storagecache/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/storagecache/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 StorageCacheManagementClient. + * A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. + */ +package com.microsoft.azure.management.storagecache.v2020_03_01;