From 843b9adf676fcc45820699126b2c556622beeae9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 30 Sep 2021 01:59:28 +0000 Subject: [PATCH] CodeGen from PR 16152 in Azure/azure-rest-api-specs [Hub Generated] Public private branch 'dev-storagecache-Microsoft.StorageCache-2021-09-01' (#16152) * Adds base for updating Microsoft.StorageCache from version stable/2021-05-01 to version 2021-09-01 * Updates readme * Updates API version in new specs and examples * 2021-09-01 API * Fix LintDiff Co-authored-by: rebecca337 <80353400+rebecca337@users.noreply.github.com> Co-authored-by: Rebecca Dupuis --- .../CHANGELOG.md | 3 +- .../README.md | 5 +- .../pom.xml | 2 +- .../storagecache/StorageCacheManager.java | 2 +- .../storagecache/fluent/SkusClient.java | 4 +- .../fluent/models/ApiOperationInner.java | 30 +- .../fluent/models/ApiOperationProperties.java | 55 ---- .../fluent/models/AscOperationInner.java | 31 +- .../fluent/models/AscOperationProperties.java | 53 ---- .../fluent/models/CacheInner.java | 179 +++++++----- .../fluent/models/CacheProperties.java | 268 ------------------ .../fluent/models/StorageTargetInner.java | 139 ++++++--- .../models/StorageTargetProperties.java | 226 --------------- .../implementation/SkusClientImpl.java | 12 +- .../StorageCacheManagementClientImpl.java | 2 +- .../implementation/StorageTargetImpl.java | 10 + .../models/OperationalStateType.java | 40 +++ .../storagecache/models/Skus.java | 4 +- .../storagecache/models/StorageTarget.java | 29 ++ .../storagecache/AscOperationsGetSamples.java | 22 -- .../CachesCreateOrUpdateSamples.java | 177 ------------ .../storagecache/CachesDebugInfoSamples.java | 21 -- .../storagecache/CachesDeleteSamples.java | 21 -- .../storagecache/CachesFlushSamples.java | 21 -- .../CachesGetByResourceGroupSamples.java | 21 -- .../CachesListByResourceGroupSamples.java | 22 -- .../storagecache/CachesListSamples.java | 21 -- .../storagecache/CachesStartSamples.java | 21 -- .../storagecache/CachesStopSamples.java | 21 -- .../storagecache/CachesUpdateSamples.java | 192 ------------- .../CachesUpgradeFirmwareSamples.java | 22 -- .../storagecache/OperationsListSamples.java | 22 -- .../storagecache/SkusListSamples.java | 21 -- .../StorageTargetOperationFlushSamples.java | 22 -- .../StorageTargetOperationResumeSamples.java | 22 -- .../StorageTargetOperationSuspendSamples.java | 22 -- .../StorageTargetsCreateOrUpdateSamples.java | 86 ------ .../StorageTargetsDeleteSamples.java | 22 -- .../StorageTargetsDnsRefreshSamples.java | 22 -- .../StorageTargetsGetSamples.java | 22 -- .../StorageTargetsListByCacheSamples.java | 22 -- .../storagecache/UsageModelsListSamples.java | 21 -- 42 files changed, 323 insertions(+), 1657 deletions(-) delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationProperties.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationProperties.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java create mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/AscOperationsGetSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesCreateOrUpdateSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDebugInfoSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDeleteSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesFlushSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesGetByResourceGroupSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListByResourceGroupSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStartSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStopSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpdateSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpgradeFirmwareSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/OperationsListSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/SkusListSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationFlushSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationResumeSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationSuspendSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsCreateOrUpdateSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDeleteSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDnsRefreshSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsGetSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsListByCacheSamples.java delete mode 100644 sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/UsageModelsListSamples.java diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md b/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md index 4d5dea63dcc9b..26289637bda54 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md +++ b/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2021-09-30) +- Azure Resource Manager StorageCache client library for Java. This package contains Microsoft Azure SDK for StorageCache Management SDK. 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 tag package-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.3 (2021-08-03) diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/README.md b/sdk/storagecache/azure-resourcemanager-storagecache/README.md index c733339043bd2..b8a43d3e9e8a1 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/README.md +++ b/sdk/storagecache/azure-resourcemanager-storagecache/README.md @@ -2,7 +2,7 @@ Azure Resource Manager StorageCache client library for Java. -This package contains Microsoft Azure SDK for StorageCache Management SDK. 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 tag package-2021-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for StorageCache Management SDK. 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 tag package-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-storagecache - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -74,7 +74,6 @@ See [API design][design] for general introduction on design and key concepts on ## Examples -[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storagecache/azure-resourcemanager-storagecache/SAMPLE.md) ## Troubleshooting diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml b/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml index 8e3e9fd74b7b3..a8d309705ba7d 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml +++ b/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for StorageCache Management - This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. 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 tag package-2021-05. + This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. 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 tag package-2021-09. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java index 463b1880df29e..7d4f936f4a71e 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java @@ -198,7 +198,7 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.storagecache") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/SkusClient.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/SkusClient.java index c328f4b11293b..2f6ee7fd4aa37 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/SkusClient.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/SkusClient.java @@ -17,7 +17,7 @@ public interface SkusClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface SkusClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationInner.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationInner.java index 2cae7cd7ef309..a32bf6d549def 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationInner.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationInner.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.storagecache.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.storagecache.models.ApiOperationDisplay; import com.azure.resourcemanager.storagecache.models.ApiOperationPropertiesServiceSpecification; @@ -15,8 +16,9 @@ * REST API operation description: see * https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation. */ +@JsonFlatten @Fluent -public final class ApiOperationInner { +public class ApiOperationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationInner.class); /* @@ -44,10 +46,10 @@ public final class ApiOperationInner { private String name; /* - * Additional details about an operation. + * Specification of the all the metrics provided for a resource type. */ - @JsonProperty(value = "properties") - private ApiOperationProperties innerProperties; + @JsonProperty(value = "properties.serviceSpecification") + private ApiOperationPropertiesServiceSpecification serviceSpecification; /** * Get the display property: The object that represents the operation. @@ -129,22 +131,13 @@ public ApiOperationInner withName(String name) { return this; } - /** - * Get the innerProperties property: Additional details about an operation. - * - * @return the innerProperties value. - */ - private ApiOperationProperties innerProperties() { - return this.innerProperties; - } - /** * Get the serviceSpecification property: Specification of the all the metrics provided for a resource type. * * @return the serviceSpecification value. */ public ApiOperationPropertiesServiceSpecification serviceSpecification() { - return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification(); + return this.serviceSpecification; } /** @@ -154,10 +147,7 @@ public ApiOperationPropertiesServiceSpecification serviceSpecification() { * @return the ApiOperationInner object itself. */ public ApiOperationInner withServiceSpecification(ApiOperationPropertiesServiceSpecification serviceSpecification) { - if (this.innerProperties() == null) { - this.innerProperties = new ApiOperationProperties(); - } - this.innerProperties().withServiceSpecification(serviceSpecification); + this.serviceSpecification = serviceSpecification; return this; } @@ -170,8 +160,8 @@ public void validate() { if (display() != null) { display().validate(); } - if (innerProperties() != null) { - innerProperties().validate(); + if (serviceSpecification() != null) { + serviceSpecification().validate(); } } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationProperties.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationProperties.java deleted file mode 100644 index 511725c343824..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/ApiOperationProperties.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storagecache.models.ApiOperationPropertiesServiceSpecification; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Additional details about an operation. */ -@Fluent -public final class ApiOperationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationProperties.class); - - /* - * Specification of the all the metrics provided for a resource type. - */ - @JsonProperty(value = "serviceSpecification") - private ApiOperationPropertiesServiceSpecification serviceSpecification; - - /** - * Get the serviceSpecification property: Specification of the all the metrics provided for a resource type. - * - * @return the serviceSpecification value. - */ - public ApiOperationPropertiesServiceSpecification serviceSpecification() { - return this.serviceSpecification; - } - - /** - * Set the serviceSpecification property: Specification of the all the metrics provided for a resource type. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the ApiOperationProperties object itself. - */ - public ApiOperationProperties withServiceSpecification( - ApiOperationPropertiesServiceSpecification serviceSpecification) { - this.serviceSpecification = serviceSpecification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceSpecification() != null) { - serviceSpecification().validate(); - } - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationInner.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationInner.java index e5f995713cbe5..95f95a8cb5292 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationInner.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationInner.java @@ -5,15 +5,18 @@ package com.azure.resourcemanager.storagecache.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.storagecache.models.ErrorResponse; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The status of operation. */ +@JsonFlatten @Fluent -public final class AscOperationInner { +public class AscOperationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(AscOperationInner.class); /* @@ -53,10 +56,11 @@ public final class AscOperationInner { private ErrorResponse error; /* - * Additional operation-specific properties + * Additional operation-specific output. */ - @JsonProperty(value = "properties") - private AscOperationProperties innerProperties; + @JsonProperty(value = "properties.output") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map output; /** * Get the id property: The operation Id. @@ -178,22 +182,13 @@ public AscOperationInner withError(ErrorResponse error) { return this; } - /** - * Get the innerProperties property: Additional operation-specific properties. - * - * @return the innerProperties value. - */ - private AscOperationProperties innerProperties() { - return this.innerProperties; - } - /** * Get the output property: Additional operation-specific output. * * @return the output value. */ public Map output() { - return this.innerProperties() == null ? null : this.innerProperties().output(); + return this.output; } /** @@ -203,10 +198,7 @@ public Map output() { * @return the AscOperationInner object itself. */ public AscOperationInner withOutput(Map output) { - if (this.innerProperties() == null) { - this.innerProperties = new AscOperationProperties(); - } - this.innerProperties().withOutput(output); + this.output = output; return this; } @@ -219,8 +211,5 @@ public void validate() { if (error() != null) { error().validate(); } - if (innerProperties() != null) { - innerProperties().validate(); - } } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationProperties.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationProperties.java deleted file mode 100644 index f88b3e32b4d53..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/AscOperationProperties.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Additional operation-specific output. */ -@Fluent -public final class AscOperationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AscOperationProperties.class); - - /* - * Additional operation-specific output. - */ - @JsonProperty(value = "output") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map output; - - /** - * Get the output property: Additional operation-specific output. - * - * @return the output value. - */ - public Map output() { - return this.output; - } - - /** - * Set the output property: Additional operation-specific output. - * - * @param output the output value to set. - * @return the AscOperationProperties object itself. - */ - public AscOperationProperties withOutput(Map output) { - this.output = output; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java index e6ad52c0b6a6f..c6c515e422c91 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.storagecache.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; @@ -26,8 +27,9 @@ * 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 @Fluent -public final class CacheInner extends Resource { +public class CacheInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheInner.class); /* @@ -42,18 +44,73 @@ public final class CacheInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * Properties of the Cache. - */ - @JsonProperty(value = "properties") - private CacheProperties innerProperties; - /* * SKU for the Cache. */ @JsonProperty(value = "sku") private CacheSku sku; + /* + * 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 + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateType provisioningState; + + /* + * Subnet used for the Cache. + */ + @JsonProperty(value = "properties.subnet") + private String subnet; + + /* + * Upgrade status of the Cache. + */ + @JsonProperty(value = "properties.upgradeStatus", access = JsonProperty.Access.WRITE_ONLY) + 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; + + /* + * Specifies Directory Services settings of the cache. + */ + @JsonProperty(value = "properties.directoryServicesSettings") + private CacheDirectorySettings directoryServicesSettings; + /** * Get the identity property: The identity of the cache, if configured. * @@ -83,15 +140,6 @@ public SystemData systemData() { return this.systemData; } - /** - * Get the innerProperties property: Properties of the Cache. - * - * @return the innerProperties value. - */ - private CacheProperties innerProperties() { - return this.innerProperties; - } - /** * Get the sku property: SKU for the Cache. * @@ -112,27 +160,13 @@ public CacheInner withSku(CacheSku sku) { return this; } - /** {@inheritDoc} */ - @Override - public CacheInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public CacheInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the cacheSizeGB property: The size of this Cache, in GB. * * @return the cacheSizeGB value. */ public Integer cacheSizeGB() { - return this.innerProperties() == null ? null : this.innerProperties().cacheSizeGB(); + return this.cacheSizeGB; } /** @@ -142,10 +176,7 @@ public Integer cacheSizeGB() { * @return the CacheInner object itself. */ public CacheInner withCacheSizeGB(Integer cacheSizeGB) { - if (this.innerProperties() == null) { - this.innerProperties = new CacheProperties(); - } - this.innerProperties().withCacheSizeGB(cacheSizeGB); + this.cacheSizeGB = cacheSizeGB; return this; } @@ -155,7 +186,7 @@ public CacheInner withCacheSizeGB(Integer cacheSizeGB) { * @return the health value. */ public CacheHealth health() { - return this.innerProperties() == null ? null : this.innerProperties().health(); + return this.health; } /** @@ -164,7 +195,7 @@ public CacheHealth health() { * @return the mountAddresses value. */ public List mountAddresses() { - return this.innerProperties() == null ? null : this.innerProperties().mountAddresses(); + return this.mountAddresses; } /** @@ -174,7 +205,7 @@ public List mountAddresses() { * @return the provisioningState value. */ public ProvisioningStateType provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + return this.provisioningState; } /** @@ -183,7 +214,7 @@ public ProvisioningStateType provisioningState() { * @return the subnet value. */ public String subnet() { - return this.innerProperties() == null ? null : this.innerProperties().subnet(); + return this.subnet; } /** @@ -193,10 +224,7 @@ public String subnet() { * @return the CacheInner object itself. */ public CacheInner withSubnet(String subnet) { - if (this.innerProperties() == null) { - this.innerProperties = new CacheProperties(); - } - this.innerProperties().withSubnet(subnet); + this.subnet = subnet; return this; } @@ -206,7 +234,7 @@ public CacheInner withSubnet(String subnet) { * @return the upgradeStatus value. */ public CacheUpgradeStatus upgradeStatus() { - return this.innerProperties() == null ? null : this.innerProperties().upgradeStatus(); + return this.upgradeStatus; } /** @@ -215,7 +243,7 @@ public CacheUpgradeStatus upgradeStatus() { * @return the networkSettings value. */ public CacheNetworkSettings networkSettings() { - return this.innerProperties() == null ? null : this.innerProperties().networkSettings(); + return this.networkSettings; } /** @@ -225,10 +253,7 @@ public CacheNetworkSettings networkSettings() { * @return the CacheInner object itself. */ public CacheInner withNetworkSettings(CacheNetworkSettings networkSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new CacheProperties(); - } - this.innerProperties().withNetworkSettings(networkSettings); + this.networkSettings = networkSettings; return this; } @@ -238,7 +263,7 @@ public CacheInner withNetworkSettings(CacheNetworkSettings networkSettings) { * @return the encryptionSettings value. */ public CacheEncryptionSettings encryptionSettings() { - return this.innerProperties() == null ? null : this.innerProperties().encryptionSettings(); + return this.encryptionSettings; } /** @@ -248,10 +273,7 @@ public CacheEncryptionSettings encryptionSettings() { * @return the CacheInner object itself. */ public CacheInner withEncryptionSettings(CacheEncryptionSettings encryptionSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new CacheProperties(); - } - this.innerProperties().withEncryptionSettings(encryptionSettings); + this.encryptionSettings = encryptionSettings; return this; } @@ -261,7 +283,7 @@ public CacheInner withEncryptionSettings(CacheEncryptionSettings encryptionSetti * @return the securitySettings value. */ public CacheSecuritySettings securitySettings() { - return this.innerProperties() == null ? null : this.innerProperties().securitySettings(); + return this.securitySettings; } /** @@ -271,10 +293,7 @@ public CacheSecuritySettings securitySettings() { * @return the CacheInner object itself. */ public CacheInner withSecuritySettings(CacheSecuritySettings securitySettings) { - if (this.innerProperties() == null) { - this.innerProperties = new CacheProperties(); - } - this.innerProperties().withSecuritySettings(securitySettings); + this.securitySettings = securitySettings; return this; } @@ -284,7 +303,7 @@ public CacheInner withSecuritySettings(CacheSecuritySettings securitySettings) { * @return the directoryServicesSettings value. */ public CacheDirectorySettings directoryServicesSettings() { - return this.innerProperties() == null ? null : this.innerProperties().directoryServicesSettings(); + return this.directoryServicesSettings; } /** @@ -294,10 +313,21 @@ public CacheDirectorySettings directoryServicesSettings() { * @return the CacheInner object itself. */ public CacheInner withDirectoryServicesSettings(CacheDirectorySettings directoryServicesSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new CacheProperties(); - } - this.innerProperties().withDirectoryServicesSettings(directoryServicesSettings); + this.directoryServicesSettings = directoryServicesSettings; + return this; + } + + /** {@inheritDoc} */ + @Override + public CacheInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CacheInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -310,11 +340,26 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (innerProperties() != null) { - innerProperties().validate(); - } if (sku() != null) { sku().validate(); } + if (health() != null) { + health().validate(); + } + if (upgradeStatus() != null) { + upgradeStatus().validate(); + } + if (networkSettings() != null) { + networkSettings().validate(); + } + if (encryptionSettings() != null) { + encryptionSettings().validate(); + } + if (securitySettings() != null) { + securitySettings().validate(); + } + if (directoryServicesSettings() != null) { + directoryServicesSettings().validate(); + } } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java deleted file mode 100644 index f1a43a15f29df..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storagecache.models.CacheDirectorySettings; -import com.azure.resourcemanager.storagecache.models.CacheEncryptionSettings; -import com.azure.resourcemanager.storagecache.models.CacheHealth; -import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings; -import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; -import com.azure.resourcemanager.storagecache.models.CacheUpgradeStatus; -import com.azure.resourcemanager.storagecache.models.ProvisioningStateType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the Cache. */ -@Fluent -public final class CacheProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheProperties.class); - - /* - * The size of this Cache, in GB. - */ - @JsonProperty(value = "cacheSizeGB") - private Integer cacheSizeGB; - - /* - * Health of the Cache. - */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) - private CacheHealth health; - - /* - * Array of IP addresses that can be used by clients mounting this Cache. - */ - @JsonProperty(value = "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 - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningStateType provisioningState; - - /* - * Subnet used for the Cache. - */ - @JsonProperty(value = "subnet") - private String subnet; - - /* - * Upgrade status of the Cache. - */ - @JsonProperty(value = "upgradeStatus", access = JsonProperty.Access.WRITE_ONLY) - private CacheUpgradeStatus upgradeStatus; - - /* - * Specifies network settings of the cache. - */ - @JsonProperty(value = "networkSettings") - private CacheNetworkSettings networkSettings; - - /* - * Specifies encryption settings of the cache. - */ - @JsonProperty(value = "encryptionSettings") - private CacheEncryptionSettings encryptionSettings; - - /* - * Specifies security settings of the cache. - */ - @JsonProperty(value = "securitySettings") - private CacheSecuritySettings securitySettings; - - /* - * Specifies Directory Services settings of the cache. - */ - @JsonProperty(value = "directoryServicesSettings") - private CacheDirectorySettings directoryServicesSettings; - - /** - * Get the cacheSizeGB property: The size of this Cache, in GB. - * - * @return the cacheSizeGB value. - */ - public Integer cacheSizeGB() { - return this.cacheSizeGB; - } - - /** - * Set the cacheSizeGB property: The size of this Cache, in GB. - * - * @param cacheSizeGB the cacheSizeGB value to set. - * @return the CacheProperties object itself. - */ - public CacheProperties withCacheSizeGB(Integer cacheSizeGB) { - this.cacheSizeGB = cacheSizeGB; - return this; - } - - /** - * Get the health property: Health of the Cache. - * - * @return the health value. - */ - public CacheHealth health() { - return this.health; - } - - /** - * Get the mountAddresses property: Array of IP addresses that can be used by clients mounting this Cache. - * - * @return the mountAddresses value. - */ - public List mountAddresses() { - return this.mountAddresses; - } - - /** - * Get the provisioningState property: ARM provisioning state, see - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - * - * @return the provisioningState value. - */ - public ProvisioningStateType provisioningState() { - return this.provisioningState; - } - - /** - * Get the subnet property: Subnet used for the Cache. - * - * @return the subnet value. - */ - public String subnet() { - return this.subnet; - } - - /** - * Set the subnet property: Subnet used for the Cache. - * - * @param subnet the subnet value to set. - * @return the CacheProperties object itself. - */ - public CacheProperties withSubnet(String subnet) { - this.subnet = subnet; - return this; - } - - /** - * Get the upgradeStatus property: Upgrade status of the Cache. - * - * @return the upgradeStatus value. - */ - public CacheUpgradeStatus upgradeStatus() { - return this.upgradeStatus; - } - - /** - * Get the networkSettings property: Specifies network settings of the cache. - * - * @return the networkSettings value. - */ - public CacheNetworkSettings networkSettings() { - return this.networkSettings; - } - - /** - * Set the networkSettings property: Specifies network settings of the cache. - * - * @param networkSettings the networkSettings value to set. - * @return the CacheProperties object itself. - */ - public CacheProperties withNetworkSettings(CacheNetworkSettings networkSettings) { - this.networkSettings = networkSettings; - return this; - } - - /** - * Get the encryptionSettings property: Specifies encryption settings of the cache. - * - * @return the encryptionSettings value. - */ - public CacheEncryptionSettings encryptionSettings() { - return this.encryptionSettings; - } - - /** - * Set the encryptionSettings property: Specifies encryption settings of the cache. - * - * @param encryptionSettings the encryptionSettings value to set. - * @return the CacheProperties object itself. - */ - public CacheProperties withEncryptionSettings(CacheEncryptionSettings encryptionSettings) { - this.encryptionSettings = encryptionSettings; - return this; - } - - /** - * Get the securitySettings property: Specifies security settings of the cache. - * - * @return the securitySettings value. - */ - public CacheSecuritySettings securitySettings() { - return this.securitySettings; - } - - /** - * Set the securitySettings property: Specifies security settings of the cache. - * - * @param securitySettings the securitySettings value to set. - * @return the CacheProperties object itself. - */ - public CacheProperties withSecuritySettings(CacheSecuritySettings securitySettings) { - this.securitySettings = securitySettings; - return this; - } - - /** - * Get the directoryServicesSettings property: Specifies Directory Services settings of the cache. - * - * @return the directoryServicesSettings value. - */ - public CacheDirectorySettings directoryServicesSettings() { - return this.directoryServicesSettings; - } - - /** - * Set the directoryServicesSettings property: Specifies Directory Services settings of the cache. - * - * @param directoryServicesSettings the directoryServicesSettings value to set. - * @return the CacheProperties object itself. - */ - public CacheProperties withDirectoryServicesSettings(CacheDirectorySettings directoryServicesSettings) { - this.directoryServicesSettings = directoryServicesSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (health() != null) { - health().validate(); - } - if (upgradeStatus() != null) { - upgradeStatus().validate(); - } - if (networkSettings() != null) { - networkSettings().validate(); - } - if (encryptionSettings() != null) { - encryptionSettings().validate(); - } - if (securitySettings() != null) { - securitySettings().validate(); - } - if (directoryServicesSettings() != null) { - directoryServicesSettings().validate(); - } - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java index 80819c5118d29..52a9b06ec86e9 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java @@ -5,11 +5,13 @@ package com.azure.resourcemanager.storagecache.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.storagecache.models.BlobNfsTarget; import com.azure.resourcemanager.storagecache.models.ClfsTarget; import com.azure.resourcemanager.storagecache.models.NamespaceJunction; import com.azure.resourcemanager.storagecache.models.Nfs3Target; +import com.azure.resourcemanager.storagecache.models.OperationalStateType; import com.azure.resourcemanager.storagecache.models.ProvisioningStateType; import com.azure.resourcemanager.storagecache.models.StorageTargetResource; import com.azure.resourcemanager.storagecache.models.StorageTargetType; @@ -19,24 +21,59 @@ import java.util.List; /** Type of the Storage Target. */ +@JsonFlatten @Fluent -public final class StorageTargetInner extends StorageTargetResource { +public class StorageTargetInner extends StorageTargetResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageTargetInner.class); /* - * StorageTarget properties + * List of Cache namespace junctions to target for namespace associations. */ - @JsonProperty(value = "properties") - private StorageTargetProperties innerProperties; + @JsonProperty(value = "properties.junctions") + private List junctions; - /** - * Get the innerProperties property: StorageTarget properties. - * - * @return the innerProperties value. + /* + * Type of the Storage Target. */ - private StorageTargetProperties innerProperties() { - return this.innerProperties; - } + @JsonProperty(value = "properties.targetType") + private StorageTargetType targetType; + + /* + * ARM provisioning state, see + * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateType provisioningState; + + /* + * Storage target operational state. + */ + @JsonProperty(value = "properties.state") + private OperationalStateType state; + + /* + * 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; + + /* + * Properties when targetType is blobNfs. + */ + @JsonProperty(value = "properties.blobNfs") + private BlobNfsTarget blobNfs; /** * Get the junctions property: List of Cache namespace junctions to target for namespace associations. @@ -44,7 +81,7 @@ private StorageTargetProperties innerProperties() { * @return the junctions value. */ public List junctions() { - return this.innerProperties() == null ? null : this.innerProperties().junctions(); + return this.junctions; } /** @@ -54,10 +91,7 @@ public List junctions() { * @return the StorageTargetInner object itself. */ public StorageTargetInner withJunctions(List junctions) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageTargetProperties(); - } - this.innerProperties().withJunctions(junctions); + this.junctions = junctions; return this; } @@ -67,7 +101,7 @@ public StorageTargetInner withJunctions(List junctions) { * @return the targetType value. */ public StorageTargetType targetType() { - return this.innerProperties() == null ? null : this.innerProperties().targetType(); + return this.targetType; } /** @@ -77,10 +111,7 @@ public StorageTargetType targetType() { * @return the StorageTargetInner object itself. */ public StorageTargetInner withTargetType(StorageTargetType targetType) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageTargetProperties(); - } - this.innerProperties().withTargetType(targetType); + this.targetType = targetType; return this; } @@ -91,7 +122,27 @@ public StorageTargetInner withTargetType(StorageTargetType targetType) { * @return the provisioningState value. */ public ProvisioningStateType provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + return this.provisioningState; + } + + /** + * Get the state property: Storage target operational state. + * + * @return the state value. + */ + public OperationalStateType state() { + return this.state; + } + + /** + * Set the state property: Storage target operational state. + * + * @param state the state value to set. + * @return the StorageTargetInner object itself. + */ + public StorageTargetInner withState(OperationalStateType state) { + this.state = state; + return this; } /** @@ -100,7 +151,7 @@ public ProvisioningStateType provisioningState() { * @return the nfs3 value. */ public Nfs3Target nfs3() { - return this.innerProperties() == null ? null : this.innerProperties().nfs3(); + return this.nfs3; } /** @@ -110,10 +161,7 @@ public Nfs3Target nfs3() { * @return the StorageTargetInner object itself. */ public StorageTargetInner withNfs3(Nfs3Target nfs3) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageTargetProperties(); - } - this.innerProperties().withNfs3(nfs3); + this.nfs3 = nfs3; return this; } @@ -123,7 +171,7 @@ public StorageTargetInner withNfs3(Nfs3Target nfs3) { * @return the clfs value. */ public ClfsTarget clfs() { - return this.innerProperties() == null ? null : this.innerProperties().clfs(); + return this.clfs; } /** @@ -133,10 +181,7 @@ public ClfsTarget clfs() { * @return the StorageTargetInner object itself. */ public StorageTargetInner withClfs(ClfsTarget clfs) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageTargetProperties(); - } - this.innerProperties().withClfs(clfs); + this.clfs = clfs; return this; } @@ -146,7 +191,7 @@ public StorageTargetInner withClfs(ClfsTarget clfs) { * @return the unknown value. */ public UnknownTarget unknown() { - return this.innerProperties() == null ? null : this.innerProperties().unknown(); + return this.unknown; } /** @@ -156,10 +201,7 @@ public UnknownTarget unknown() { * @return the StorageTargetInner object itself. */ public StorageTargetInner withUnknown(UnknownTarget unknown) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageTargetProperties(); - } - this.innerProperties().withUnknown(unknown); + this.unknown = unknown; return this; } @@ -169,7 +211,7 @@ public StorageTargetInner withUnknown(UnknownTarget unknown) { * @return the blobNfs value. */ public BlobNfsTarget blobNfs() { - return this.innerProperties() == null ? null : this.innerProperties().blobNfs(); + return this.blobNfs; } /** @@ -179,10 +221,7 @@ public BlobNfsTarget blobNfs() { * @return the StorageTargetInner object itself. */ public StorageTargetInner withBlobNfs(BlobNfsTarget blobNfs) { - if (this.innerProperties() == null) { - this.innerProperties = new StorageTargetProperties(); - } - this.innerProperties().withBlobNfs(blobNfs); + this.blobNfs = blobNfs; return this; } @@ -194,8 +233,20 @@ public StorageTargetInner withBlobNfs(BlobNfsTarget blobNfs) { @Override public void validate() { super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); + if (junctions() != null) { + junctions().forEach(e -> e.validate()); + } + if (nfs3() != null) { + nfs3().validate(); + } + if (clfs() != null) { + clfs().validate(); + } + if (unknown() != null) { + unknown().validate(); + } + if (blobNfs() != null) { + blobNfs().validate(); } } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java deleted file mode 100644 index 7911afa098617..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storagecache.models.BlobNfsTarget; -import com.azure.resourcemanager.storagecache.models.ClfsTarget; -import com.azure.resourcemanager.storagecache.models.NamespaceJunction; -import com.azure.resourcemanager.storagecache.models.Nfs3Target; -import com.azure.resourcemanager.storagecache.models.ProvisioningStateType; -import com.azure.resourcemanager.storagecache.models.StorageTargetType; -import com.azure.resourcemanager.storagecache.models.UnknownTarget; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the Storage Target. */ -@Fluent -public final class StorageTargetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageTargetProperties.class); - - /* - * List of Cache namespace junctions to target for namespace associations. - */ - @JsonProperty(value = "junctions") - private List junctions; - - /* - * Type of the Storage Target. - */ - @JsonProperty(value = "targetType", required = true) - private StorageTargetType targetType; - - /* - * ARM provisioning state, see - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - 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; - - /* - * Properties when targetType is blobNfs. - */ - @JsonProperty(value = "blobNfs") - private BlobNfsTarget blobNfs; - - /** - * Get the junctions property: List of Cache namespace junctions to target for namespace associations. - * - * @return the junctions value. - */ - public List junctions() { - return this.junctions; - } - - /** - * Set the junctions property: 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 the targetType property: Type of the Storage Target. - * - * @return the targetType value. - */ - public StorageTargetType targetType() { - return this.targetType; - } - - /** - * Set the targetType property: Type of the Storage Target. - * - * @param targetType the targetType value to set. - * @return the StorageTargetProperties object itself. - */ - public StorageTargetProperties withTargetType(StorageTargetType targetType) { - this.targetType = targetType; - return this; - } - - /** - * Get the provisioningState property: ARM provisioning state, see - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. - * - * @return the provisioningState value. - */ - public ProvisioningStateType provisioningState() { - return this.provisioningState; - } - - /** - * Get the nfs3 property: Properties when targetType is nfs3. - * - * @return the nfs3 value. - */ - public Nfs3Target nfs3() { - return this.nfs3; - } - - /** - * Set the nfs3 property: 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 the clfs property: Properties when targetType is clfs. - * - * @return the clfs value. - */ - public ClfsTarget clfs() { - return this.clfs; - } - - /** - * Set the clfs property: 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 the unknown property: Properties when targetType is unknown. - * - * @return the unknown value. - */ - public UnknownTarget unknown() { - return this.unknown; - } - - /** - * Set the unknown property: 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; - } - - /** - * Get the blobNfs property: Properties when targetType is blobNfs. - * - * @return the blobNfs value. - */ - public BlobNfsTarget blobNfs() { - return this.blobNfs; - } - - /** - * Set the blobNfs property: Properties when targetType is blobNfs. - * - * @param blobNfs the blobNfs value to set. - * @return the StorageTargetProperties object itself. - */ - public StorageTargetProperties withBlobNfs(BlobNfsTarget blobNfs) { - this.blobNfs = blobNfs; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (junctions() != null) { - junctions().forEach(e -> e.validate()); - } - if (targetType() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property targetType in model StorageTargetProperties")); - } - if (nfs3() != null) { - nfs3().validate(); - } - if (clfs() != null) { - clfs().validate(); - } - if (unknown() != null) { - unknown().validate(); - } - if (blobNfs() != null) { - blobNfs().validate(); - } - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/SkusClientImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/SkusClientImpl.java index 0d2646ae7a898..468fdc7000df4 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/SkusClientImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/SkusClientImpl.java @@ -85,7 +85,7 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -131,7 +131,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -172,7 +172,7 @@ private Mono> listSinglePageAsync(Context contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -186,7 +186,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -199,7 +199,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -213,7 +213,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java index 030fc6aaef551..363b89e756849 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java @@ -227,7 +227,7 @@ public StorageTargetOperationsClient getStorageTargetOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-05-01"; + this.apiVersion = "2021-09-01"; this.operations = new OperationsClientImpl(this); this.skus = new SkusClientImpl(this); this.usageModels = new UsageModelsClientImpl(this); diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java index 0474f4a67e00d..bd5b94c9fc9c2 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.storagecache.models.ClfsTarget; import com.azure.resourcemanager.storagecache.models.NamespaceJunction; import com.azure.resourcemanager.storagecache.models.Nfs3Target; +import com.azure.resourcemanager.storagecache.models.OperationalStateType; import com.azure.resourcemanager.storagecache.models.ProvisioningStateType; import com.azure.resourcemanager.storagecache.models.StorageTarget; import com.azure.resourcemanager.storagecache.models.StorageTargetType; @@ -61,6 +62,10 @@ public ProvisioningStateType provisioningState() { return this.innerModel().provisioningState(); } + public OperationalStateType state() { + return this.innerModel().state(); + } + public Nfs3Target nfs3() { return this.innerModel().nfs3(); } @@ -198,6 +203,11 @@ public StorageTargetImpl withTargetType(StorageTargetType targetType) { return this; } + public StorageTargetImpl withState(OperationalStateType state) { + this.innerModel().withState(state); + return this; + } + public StorageTargetImpl withNfs3(Nfs3Target nfs3) { this.innerModel().withNfs3(nfs3); return this; diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java new file mode 100644 index 0000000000000..16875069a4422 --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationalStateType. */ +public final class OperationalStateType extends ExpandableStringEnum { + /** Static value Ready for OperationalStateType. */ + public static final OperationalStateType READY = fromString("Ready"); + + /** Static value Busy for OperationalStateType. */ + public static final OperationalStateType BUSY = fromString("Busy"); + + /** Static value Suspended for OperationalStateType. */ + public static final OperationalStateType SUSPENDED = fromString("Suspended"); + + /** Static value Flushing for OperationalStateType. */ + public static final OperationalStateType FLUSHING = fromString("Flushing"); + + /** + * Creates or finds a OperationalStateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationalStateType. + */ + @JsonCreator + public static OperationalStateType fromString(String name) { + return fromString(name, OperationalStateType.class); + } + + /** @return known OperationalStateType values. */ + public static Collection values() { + return values(OperationalStateType.class); + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Skus.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Skus.java index b3fb376d9c75d..d4132db637919 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Skus.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Skus.java @@ -14,7 +14,7 @@ public interface Skus { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Skus { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of StorageCache. + * @return the list of StorageCache.Cache SKUs available to this subscription. */ PagedIterable list(Context context); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java index c65e11e1afc05..aeeef2830c19b 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java @@ -69,6 +69,13 @@ public interface StorageTarget { */ ProvisioningStateType provisioningState(); + /** + * Gets the state property: Storage target operational state. + * + * @return the state value. + */ + OperationalStateType state(); + /** * Gets the nfs3 property: Properties when targetType is nfs3. * @@ -146,6 +153,7 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithJunctions, DefinitionStages.WithTargetType, + DefinitionStages.WithState, DefinitionStages.WithNfs3, DefinitionStages.WithClfs, DefinitionStages.WithUnknown, @@ -186,6 +194,16 @@ interface WithTargetType { */ WithCreate withTargetType(StorageTargetType targetType); } + /** The stage of the StorageTarget definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Storage target operational state.. + * + * @param state Storage target operational state. + * @return the next definition stage. + */ + WithCreate withState(OperationalStateType state); + } /** The stage of the StorageTarget definition allowing to specify nfs3. */ interface WithNfs3 { /** @@ -237,6 +255,7 @@ interface WithBlobNfs { /** The template for StorageTarget update. */ interface Update extends UpdateStages.WithJunctions, + UpdateStages.WithState, UpdateStages.WithNfs3, UpdateStages.WithClfs, UpdateStages.WithUnknown, @@ -269,6 +288,16 @@ interface WithJunctions { */ Update withJunctions(List junctions); } + /** The stage of the StorageTarget update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Storage target operational state.. + * + * @param state Storage target operational state. + * @return the next definition stage. + */ + Update withState(OperationalStateType state); + } /** The stage of the StorageTarget update allowing to specify nfs3. */ interface WithNfs3 { /** diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/AscOperationsGetSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/AscOperationsGetSamples.java deleted file mode 100644 index 14605b812bf97..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/AscOperationsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for AscOperations Get. */ -public final class AscOperationsGetSamples { - /** - * Sample code: AscOperations_Get. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void ascOperationsGet( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.ascOperations().getWithResponse("westus", "testoperationid", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesCreateOrUpdateSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesCreateOrUpdateSamples.java deleted file mode 100644 index 0c1d98ab8fc3c..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesCreateOrUpdateSamples.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.resourcemanager.storagecache.models.CacheActiveDirectorySettings; -import com.azure.resourcemanager.storagecache.models.CacheActiveDirectorySettingsCredentials; -import com.azure.resourcemanager.storagecache.models.CacheDirectorySettings; -import com.azure.resourcemanager.storagecache.models.CacheEncryptionSettings; -import com.azure.resourcemanager.storagecache.models.CacheIdentity; -import com.azure.resourcemanager.storagecache.models.CacheIdentityType; -import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; -import com.azure.resourcemanager.storagecache.models.CacheSku; -import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettings; -import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettingsCredentials; -import com.azure.resourcemanager.storagecache.models.KeyVaultKeyReference; -import com.azure.resourcemanager.storagecache.models.KeyVaultKeyReferenceSourceVault; -import com.azure.resourcemanager.storagecache.models.NfsAccessPolicy; -import com.azure.resourcemanager.storagecache.models.NfsAccessRule; -import com.azure.resourcemanager.storagecache.models.NfsAccessRuleAccess; -import com.azure.resourcemanager.storagecache.models.NfsAccessRuleScope; -import com.azure.resourcemanager.storagecache.models.UserAssignedIdentitiesValue; -import com.azure.resourcemanager.storagecache.models.UsernameSource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Caches CreateOrUpdate. */ -public final class CachesCreateOrUpdateSamples { - /** - * Sample code: Caches_CreateOrUpdate_ldap_only. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesCreateOrUpdateLdapOnly( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager - .caches() - .define("sc1") - .withRegion("westus") - .withExistingResourceGroup("scgroup") - .withTags(mapOf("Dept", "Contoso")) - .withSku(new CacheSku().withName("Standard_2G")) - .withCacheSizeGB(3072) - .withSubnet( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1") - .withEncryptionSettings( - new CacheEncryptionSettings() - .withKeyEncryptionKey( - new KeyVaultKeyReference() - .withKeyUrl("https://keyvault-cmk.vault.azure.net/keys/key2048/test") - .withSourceVault( - new KeyVaultKeyReferenceSourceVault() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk")))) - .withSecuritySettings( - new CacheSecuritySettings() - .withAccessPolicies( - Arrays - .asList( - new NfsAccessPolicy() - .withName("default") - .withAccessRules( - Arrays - .asList( - new NfsAccessRule() - .withScope(NfsAccessRuleScope.DEFAULT) - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(false) - .withSubmountAccess(true) - .withRootSquash(false)))))) - .withDirectoryServicesSettings( - new CacheDirectorySettings() - .withUsernameDownload( - new CacheUsernameDownloadSettings() - .withExtendedGroups(true) - .withUsernameSource(UsernameSource.LDAP) - .withLdapServer("192.0.2.12") - .withLdapBaseDN("dc=contosoad,dc=contoso,dc=local") - .withCredentials( - new CacheUsernameDownloadSettingsCredentials() - .withBindDn("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local") - .withBindPassword("")))) - .create(); - } - - /** - * Sample code: Caches_CreateOrUpdate. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesCreateOrUpdate( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager - .caches() - .define("sc1") - .withRegion("westus") - .withExistingResourceGroup("scgroup") - .withTags(mapOf("Dept", "Contoso")) - .withIdentity( - new CacheIdentity() - .withType(CacheIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - new UserAssignedIdentitiesValue()))) - .withSku(new CacheSku().withName("Standard_2G")) - .withCacheSizeGB(3072) - .withSubnet( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1") - .withEncryptionSettings( - new CacheEncryptionSettings() - .withKeyEncryptionKey( - new KeyVaultKeyReference() - .withKeyUrl("https://keyvault-cmk.vault.azure.net/keys/key2047/test") - .withSourceVault( - new KeyVaultKeyReferenceSourceVault() - .withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk")))) - .withSecuritySettings( - new CacheSecuritySettings() - .withAccessPolicies( - Arrays - .asList( - new NfsAccessPolicy() - .withName("default") - .withAccessRules( - Arrays - .asList( - new NfsAccessRule() - .withScope(NfsAccessRuleScope.DEFAULT) - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(false) - .withSubmountAccess(true) - .withRootSquash(false)))))) - .withDirectoryServicesSettings( - new CacheDirectorySettings() - .withActiveDirectory( - new CacheActiveDirectorySettings() - .withPrimaryDnsIpAddress("192.0.2.10") - .withSecondaryDnsIpAddress("192.0.2.11") - .withDomainName("contosoAd.contoso.local") - .withDomainNetBiosName("contosoAd") - .withCacheNetBiosName("contosoSmb") - .withCredentials( - new CacheActiveDirectorySettingsCredentials() - .withUsername("consotoAdmin") - .withPassword(""))) - .withUsernameDownload( - new CacheUsernameDownloadSettings() - .withExtendedGroups(true) - .withUsernameSource(UsernameSource.LDAP) - .withLdapServer("192.0.2.12") - .withLdapBaseDN("dc=contosoad,dc=contoso,dc=local") - .withCredentials( - new CacheUsernameDownloadSettingsCredentials() - .withBindDn("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local") - .withBindPassword("")))) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDebugInfoSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDebugInfoSamples.java deleted file mode 100644 index bbc95b5a9f111..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDebugInfoSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches DebugInfo. */ -public final class CachesDebugInfoSamples { - /** - * Sample code: Caches_DebugInfo. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesDebugInfo(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().debugInfo("scgroup", "sc", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDeleteSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDeleteSamples.java deleted file mode 100644 index 5ad84f119263f..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches Delete. */ -public final class CachesDeleteSamples { - /** - * Sample code: Caches_Delete. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesDelete(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().delete("scgroup", "sc", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesFlushSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesFlushSamples.java deleted file mode 100644 index dcc57319e6b10..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesFlushSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches Flush. */ -public final class CachesFlushSamples { - /** - * Sample code: Caches_Flush. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesFlush(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().flush("scgroup", "sc", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesGetByResourceGroupSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesGetByResourceGroupSamples.java deleted file mode 100644 index e6c6205bf44bf..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesGetByResourceGroupSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches GetByResourceGroup. */ -public final class CachesGetByResourceGroupSamples { - /** - * Sample code: Caches_Get. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesGet(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().getByResourceGroupWithResponse("scgroup", "sc1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListByResourceGroupSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListByResourceGroupSamples.java deleted file mode 100644 index 9849853a7078b..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches ListByResourceGroup. */ -public final class CachesListByResourceGroupSamples { - /** - * Sample code: Caches_ListByResourceGroup. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesListByResourceGroup( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().listByResourceGroup("scgroup", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListSamples.java deleted file mode 100644 index 1156d7d77d609..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches List. */ -public final class CachesListSamples { - /** - * Sample code: Caches_List. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesList(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().list(Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStartSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStartSamples.java deleted file mode 100644 index ad7cb2d2c83c2..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStartSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches Start. */ -public final class CachesStartSamples { - /** - * Sample code: Caches_Start. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesStart(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().start("scgroup", "sc", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStopSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStopSamples.java deleted file mode 100644 index 21f0a8bee09d0..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesStopSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches Stop. */ -public final class CachesStopSamples { - /** - * Sample code: Caches_Stop. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesStop(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().stop("scgroup", "sc", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpdateSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpdateSamples.java deleted file mode 100644 index c21b67a622684..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpdateSamples.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.storagecache.models.Cache; -import com.azure.resourcemanager.storagecache.models.CacheActiveDirectorySettings; -import com.azure.resourcemanager.storagecache.models.CacheDirectorySettings; -import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings; -import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; -import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettings; -import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettingsCredentials; -import com.azure.resourcemanager.storagecache.models.NfsAccessPolicy; -import com.azure.resourcemanager.storagecache.models.NfsAccessRule; -import com.azure.resourcemanager.storagecache.models.NfsAccessRuleAccess; -import com.azure.resourcemanager.storagecache.models.NfsAccessRuleScope; -import com.azure.resourcemanager.storagecache.models.UsernameSource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Caches Update. */ -public final class CachesUpdateSamples { - /** - * Sample code: Caches_Update_ldap_only. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesUpdateLdapOnly( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - Cache resource = - storageCacheManager.caches().getByResourceGroupWithResponse("scgroup", "sc1", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("Dept", "Contoso")) - .withNetworkSettings( - new CacheNetworkSettings() - .withMtu(1500) - .withDnsServers(Arrays.asList("10.1.22.33", "10.1.12.33")) - .withDnsSearchDomain("contoso.com") - .withNtpServer("time.contoso.com")) - .withSecuritySettings( - new CacheSecuritySettings() - .withAccessPolicies( - Arrays - .asList( - new NfsAccessPolicy() - .withName("default") - .withAccessRules( - Arrays - .asList( - new NfsAccessRule() - .withScope(NfsAccessRuleScope.DEFAULT) - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(false) - .withSubmountAccess(true) - .withRootSquash(false))), - new NfsAccessPolicy() - .withName("restrictive") - .withAccessRules( - Arrays - .asList( - new NfsAccessRule() - .withScope(NfsAccessRuleScope.HOST) - .withFilter("10.99.3.145") - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(true) - .withSubmountAccess(true) - .withRootSquash(false), - new NfsAccessRule() - .withScope(NfsAccessRuleScope.NETWORK) - .withFilter("10.99.1.0/24") - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(true) - .withSubmountAccess(true) - .withRootSquash(false), - new NfsAccessRule() - .withScope(NfsAccessRuleScope.DEFAULT) - .withAccess(NfsAccessRuleAccess.NO) - .withSuid(false) - .withSubmountAccess(true) - .withRootSquash(true) - .withAnonymousUid("65534") - .withAnonymousGid("65534")))))) - .withDirectoryServicesSettings( - new CacheDirectorySettings() - .withUsernameDownload( - new CacheUsernameDownloadSettings() - .withExtendedGroups(true) - .withUsernameSource(UsernameSource.LDAP) - .withLdapServer("192.0.2.12") - .withLdapBaseDN("dc=contosoad,dc=contoso,dc=local") - .withCredentials( - new CacheUsernameDownloadSettingsCredentials() - .withBindDn("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local") - .withBindPassword("")))) - .apply(); - } - - /** - * Sample code: Caches_Update. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesUpdate(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - Cache resource = - storageCacheManager.caches().getByResourceGroupWithResponse("scgroup", "sc1", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("Dept", "Contoso")) - .withNetworkSettings( - new CacheNetworkSettings() - .withMtu(1500) - .withDnsServers(Arrays.asList("10.1.22.33", "10.1.12.33")) - .withDnsSearchDomain("contoso.com") - .withNtpServer("time.contoso.com")) - .withSecuritySettings( - new CacheSecuritySettings() - .withAccessPolicies( - Arrays - .asList( - new NfsAccessPolicy() - .withName("default") - .withAccessRules( - Arrays - .asList( - new NfsAccessRule() - .withScope(NfsAccessRuleScope.DEFAULT) - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(false) - .withSubmountAccess(true) - .withRootSquash(false))), - new NfsAccessPolicy() - .withName("restrictive") - .withAccessRules( - Arrays - .asList( - new NfsAccessRule() - .withScope(NfsAccessRuleScope.HOST) - .withFilter("10.99.3.145") - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(true) - .withSubmountAccess(true) - .withRootSquash(false), - new NfsAccessRule() - .withScope(NfsAccessRuleScope.NETWORK) - .withFilter("10.99.1.0/24") - .withAccess(NfsAccessRuleAccess.RW) - .withSuid(true) - .withSubmountAccess(true) - .withRootSquash(false), - new NfsAccessRule() - .withScope(NfsAccessRuleScope.DEFAULT) - .withAccess(NfsAccessRuleAccess.NO) - .withSuid(false) - .withSubmountAccess(true) - .withRootSquash(true) - .withAnonymousUid("65534") - .withAnonymousGid("65534")))))) - .withDirectoryServicesSettings( - new CacheDirectorySettings() - .withActiveDirectory( - new CacheActiveDirectorySettings() - .withPrimaryDnsIpAddress("192.0.2.10") - .withSecondaryDnsIpAddress("192.0.2.11") - .withDomainName("contosoAd.contoso.local") - .withDomainNetBiosName("contosoAd") - .withCacheNetBiosName("contosoSmb")) - .withUsernameDownload( - new CacheUsernameDownloadSettings() - .withExtendedGroups(true) - .withUsernameSource(UsernameSource.AD))) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpgradeFirmwareSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpgradeFirmwareSamples.java deleted file mode 100644 index 029bbbc03b576..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/CachesUpgradeFirmwareSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Caches UpgradeFirmware. */ -public final class CachesUpgradeFirmwareSamples { - /** - * Sample code: Caches_UpgradeFirmware. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesUpgradeFirmware( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.caches().upgradeFirmware("scgroup", "sc1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/OperationsListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/OperationsListSamples.java deleted file mode 100644 index 1bfed7a822ff7..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/OperationsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Operations List. */ -public final class OperationsListSamples { - /** - * Sample code: StorageTargets_List. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsList( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.operations().list(Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/SkusListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/SkusListSamples.java deleted file mode 100644 index 6d1caae99a15d..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/SkusListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for Skus List. */ -public final class SkusListSamples { - /** - * Sample code: Skus_List. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void skusList(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.skus().list(Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationFlushSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationFlushSamples.java deleted file mode 100644 index 71cdf452d5b0b..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationFlushSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for StorageTargetOperation Flush. */ -public final class StorageTargetOperationFlushSamples { - /** - * Sample code: StorageTargets_Flush. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsFlush( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.storageTargetOperations().flush("scgroup", "sc", "st1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationResumeSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationResumeSamples.java deleted file mode 100644 index 02e4f8dec1cd2..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationResumeSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for StorageTargetOperation Resume. */ -public final class StorageTargetOperationResumeSamples { - /** - * Sample code: StorageTargets_Resume. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsResume( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.storageTargetOperations().resume("scgroup", "sc", "st1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationSuspendSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationSuspendSamples.java deleted file mode 100644 index 44548edc1471c..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetOperationSuspendSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for StorageTargetOperation Suspend. */ -public final class StorageTargetOperationSuspendSamples { - /** - * Sample code: StorageTargets_Suspend. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsSuspend( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.storageTargetOperations().suspend("scgroup", "sc", "st1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsCreateOrUpdateSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsCreateOrUpdateSamples.java deleted file mode 100644 index d72dbca31ab9d..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsCreateOrUpdateSamples.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.resourcemanager.storagecache.models.BlobNfsTarget; -import com.azure.resourcemanager.storagecache.models.NamespaceJunction; -import com.azure.resourcemanager.storagecache.models.Nfs3Target; -import com.azure.resourcemanager.storagecache.models.StorageTargetType; -import java.util.Arrays; - -/** Samples for StorageTargets CreateOrUpdate. */ -public final class StorageTargetsCreateOrUpdateSamples { - /** - * Sample code: StorageTargets_CreateOrUpdate. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsCreateOrUpdate( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager - .storageTargets() - .define("st1") - .withExistingCache("scgroup", "sc1") - .withJunctions( - Arrays - .asList( - new NamespaceJunction() - .withNamespacePath("/path/on/cache") - .withTargetPath("/path/on/exp1") - .withNfsExport("exp1") - .withNfsAccessPolicy("default"), - new NamespaceJunction() - .withNamespacePath("/path2/on/cache") - .withTargetPath("/path2/on/exp2") - .withNfsExport("exp2") - .withNfsAccessPolicy("rootSquash"))) - .withTargetType(StorageTargetType.NFS3) - .withNfs3(new Nfs3Target().withTarget("10.0.44.44").withUsageModel("READ_HEAVY_INFREQ")) - .create(); - } - - /** - * Sample code: StorageTargets_CreateOrUpdate_BlobNfs. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsCreateOrUpdateBlobNfs( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager - .storageTargets() - .define("st1") - .withExistingCache("scgroup", "sc1") - .withJunctions(Arrays.asList(new NamespaceJunction().withNamespacePath("/blobnfs"))) - .withTargetType(StorageTargetType.BLOB_NFS) - .withBlobNfs( - new BlobNfsTarget() - .withTarget( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/blofnfs/blobServices/default/containers/blobnfs") - .withUsageModel("WRITE_WORKLOAD_15")) - .create(); - } - - /** - * Sample code: StorageTargets_CreateOrUpdate_NoJunctions. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsCreateOrUpdateNoJunctions( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager - .storageTargets() - .define("st1") - .withExistingCache("scgroup", "sc1") - .withTargetType(StorageTargetType.NFS3) - .withNfs3(new Nfs3Target().withTarget("10.0.44.44").withUsageModel("READ_HEAVY_INFREQ")) - .create(); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDeleteSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDeleteSamples.java deleted file mode 100644 index d6bb1aa86156c..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for StorageTargets Delete. */ -public final class StorageTargetsDeleteSamples { - /** - * Sample code: StorageTargets_Delete. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsDelete( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.storageTargets().delete("scgroup", "sc1", "st1", null, Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDnsRefreshSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDnsRefreshSamples.java deleted file mode 100644 index e9b6736da439d..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsDnsRefreshSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for StorageTargets DnsRefresh. */ -public final class StorageTargetsDnsRefreshSamples { - /** - * Sample code: Caches_DnsRefresh. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void cachesDnsRefresh( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.storageTargets().dnsRefresh("scgroup", "sc", "st1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsGetSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsGetSamples.java deleted file mode 100644 index 6fbe0672750db..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for StorageTargets Get. */ -public final class StorageTargetsGetSamples { - /** - * Sample code: StorageTargets_Get. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsGet( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.storageTargets().getWithResponse("scgroup", "sc1", "st1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsListByCacheSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsListByCacheSamples.java deleted file mode 100644 index 9e6627a85b1e9..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/StorageTargetsListByCacheSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for StorageTargets ListByCache. */ -public final class StorageTargetsListByCacheSamples { - /** - * Sample code: StorageTargets_List. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void storageTargetsList( - com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.storageTargets().listByCache("scgroup", "sc1", Context.NONE); - } -} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/UsageModelsListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/UsageModelsListSamples.java deleted file mode 100644 index 18e4089b90947..0000000000000 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/UsageModelsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storagecache; - -import com.azure.core.util.Context; - -/** Samples for UsageModels List. */ -public final class UsageModelsListSamples { - /** - * Sample code: UsageModels_List. - * - * @param storageCacheManager Entry point to StorageCacheManager. 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. - */ - public static void usageModelsList(com.azure.resourcemanager.storagecache.StorageCacheManager storageCacheManager) { - storageCacheManager.usageModels().list(Context.NONE); - } -}