diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f2ebf6c2ebdf..2f56b0f0b8f4 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -473,6 +473,7 @@ com.azure.resourcemanager:azure-resourcemanager-databasewatcher;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-durabletask;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-arizeaiobservabilityeval;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-weightsandbiases;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-dell;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/pom.xml b/pom.xml index ff71d092c5bb..54365d50e713 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,7 @@ sdk/dataprotection sdk/defendereasm sdk/delegatednetwork + sdk/dell sdk/deploymentmanager sdk/desktopvirtualization sdk/devcenter diff --git a/sdk/dell/azure-resourcemanager-dell/CHANGELOG.md b/sdk/dell/azure-resourcemanager-dell/CHANGELOG.md new file mode 100644 index 000000000000..66a37ddf37e9 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-04-11) + +- Azure Resource Manager Dell client library for Java. This package contains Microsoft Azure SDK for Dell Management SDK. Dell Storage service. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-dell Java SDK. diff --git a/sdk/dell/azure-resourcemanager-dell/README.md b/sdk/dell/azure-resourcemanager-dell/README.md new file mode 100644 index 000000000000..5b3a79c04db9 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Dell client library for Java + +Azure Resource Manager Dell client library for Java. + +This package contains Microsoft Azure SDK for Dell Management SDK. Dell Storage service. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-dell;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-dell + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +DellManager manager = DellManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/dell/azure-resourcemanager-dell/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/dell/azure-resourcemanager-dell/SAMPLE.md b/sdk/dell/azure-resourcemanager-dell/SAMPLE.md new file mode 100644 index 000000000000..c72e9d8031be --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/SAMPLE.md @@ -0,0 +1,361 @@ +# Code snippets and samples + + +## FileSystems + +- [CreateOrUpdate](#filesystems_createorupdate) +- [Delete](#filesystems_delete) +- [GetByResourceGroup](#filesystems_getbyresourcegroup) +- [List](#filesystems_list) +- [ListByResourceGroup](#filesystems_listbyresourcegroup) +- [Update](#filesystems_update) + +## Operations + +- [List](#operations_list) +### FileSystems_CreateOrUpdate + +```java +import com.azure.resourcemanager.dell.models.Capacity; +import com.azure.resourcemanager.dell.models.EncryptionIdentityType; +import com.azure.resourcemanager.dell.models.EncryptionIdentityUpdateProperties; +import com.azure.resourcemanager.dell.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.dell.models.FileSystemResource; +import com.azure.resourcemanager.dell.models.FileSystemResourceUpdateProperties; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityUpdate; +import com.azure.resourcemanager.dell.models.ResourceEncryptionType; +import com.azure.resourcemanager.dell.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileSystems Update. + */ +public final class FileSystemsUpdateSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_Update_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsUpdateMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + FileSystemResource resource = manager.fileSystems() + .getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new FileSystemResourceUpdateProperties().withDelegatedSubnetId("uqfvajvyltgmqvdnxhbrfqbpuey") + .withCapacity(new Capacity().withCurrent("5"))) + .apply(); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_Update_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsUpdateMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + FileSystemResource resource = manager.fileSystems() + .getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key6099", "fakeTokenPlaceholder")) + .withIdentity( + new ManagedServiceIdentityUpdate().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key7645", new UserAssignedIdentity()))) + .withProperties(new FileSystemResourceUpdateProperties().withDelegatedSubnetId("bfpuabdz") + .withCapacity(new Capacity().withCurrent("5")) + .withEncryption(new EncryptionUpdateProperties() + .withEncryptionType(ResourceEncryptionType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withKeyUrl("fakeTokenPlaceholder") + .withEncryptionIdentityProperties(new EncryptionIdentityUpdateProperties() + .withIdentityType(EncryptionIdentityType.USER_ASSIGNED) + .withIdentityResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}")))) + .apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### FileSystems_Delete + +```java +import com.azure.resourcemanager.dell.models.EncryptionIdentityProperties; +import com.azure.resourcemanager.dell.models.EncryptionIdentityType; +import com.azure.resourcemanager.dell.models.EncryptionProperties; +import com.azure.resourcemanager.dell.models.FileSystemResourceProperties; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentity; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dell.models.MarketplaceDetails; +import com.azure.resourcemanager.dell.models.ResourceEncryptionType; +import com.azure.resourcemanager.dell.models.UserAssignedIdentity; +import com.azure.resourcemanager.dell.models.UserDetails; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileSystems CreateOrUpdate. + */ +public final class FileSystemsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems() + .define("abcd") + .withRegion("cvbmsqftppe") + .withExistingResourceGroup("rgDell") + .withTags(mapOf("key7594", "fakeTokenPlaceholder")) + .withProperties(new FileSystemResourceProperties() + .withMarketplace(new MarketplaceDetails().withMarketplaceSubscriptionId("mvjcxwndudbylynme") + .withPlanId("eekvwfndjoxijeasksnt") + .withOfferId("bcganbkmvznyqfnvhjuag") + .withPublisherId("trdzykoeskmcwpo") + .withPrivateOfferId("privateOfferId") + .withPlanName("planeName")) + .withDelegatedSubnetId("rqkpvczbtqcxiaivtbuixblb") + .withDelegatedSubnetCidr("10.0.0.1/24") + .withUser(new UserDetails().withEmail("jwogfgznmjabdbcjcljjlkxdpc")) + .withSmartConnectFqdn("fqdn") + .withDellReferenceNumber("fhewkj") + .withEncryption(new EncryptionProperties() + .withEncryptionType(ResourceEncryptionType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withKeyUrl("fakeTokenPlaceholder") + .withEncryptionIdentityProperties(new EncryptionIdentityProperties() + .withIdentityType(EncryptionIdentityType.USER_ASSIGNED) + .withIdentityResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key7644", new UserAssignedIdentity()))) + .create(); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems() + .define("abcd") + .withRegion("tbcvhxzpgrijtdygkttnfswwtacs") + .withExistingResourceGroup("rgDell") + .withProperties(new FileSystemResourceProperties() + .withMarketplace(new MarketplaceDetails().withPlanId("lgozf") + .withOfferId("pzhjvibxqgeqkndqnjlduwnxqbr") + .withPrivateOfferId("privateOfferId") + .withPlanName("planeName")) + .withDelegatedSubnetId("yp") + .withDelegatedSubnetCidr("10.0.0.1/24") + .withUser(new UserDetails().withEmail("hoznewwtzmyjzctzosfuh")) + .withDellReferenceNumber("fhewkj") + .withEncryption(new EncryptionProperties() + .withEncryptionType(ResourceEncryptionType.ENCRYPTION_AT_REST_WITH_MICROSOFT_KEY))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### FileSystems_GetByResourceGroup + +```java +/** + * Samples for FileSystems Delete. + */ +public final class FileSystemsDeleteSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_Delete_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsDeleteMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().delete("rgDell", "abcd", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_Delete_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsDeleteMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().delete("rgDell", "abcd", com.azure.core.util.Context.NONE); + } +} +``` + +### FileSystems_List + +```java +/** + * Samples for FileSystems GetByResourceGroup. + */ +public final class FileSystemsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_Get_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsGetMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_Get_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsGetMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE); + } +} +``` + +### FileSystems_ListByResourceGroup + +```java +/** + * Samples for FileSystems List. + */ +public final class FileSystemsListSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListBySubscriptionMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListBySubscriptionMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().list(com.azure.core.util.Context.NONE); + } +} +``` + +### FileSystems_Update + +```java +/** + * Samples for FileSystems ListByResourceGroup. + */ +public final class FileSystemsListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListByResourceGroupMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().listByResourceGroup("rgDell", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListByResourceGroupMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().listByResourceGroup("rgDell", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-03-21-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/dell/azure-resourcemanager-dell/pom.xml b/sdk/dell/azure-resourcemanager-dell/pom.xml new file mode 100644 index 000000000000..961b180b9c45 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-dell + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Dell Management + This package contains Microsoft Azure SDK for Dell Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Dell Storage service. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + com.azure + azure-core-test + 1.27.0-beta.8 + test + + + com.azure + azure-identity + 1.15.4 + test + + + diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/DellManager.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/DellManager.java new file mode 100644 index 000000000000..62acee3f2130 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/DellManager.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dell.fluent.StorageClient; +import com.azure.resourcemanager.dell.implementation.FileSystemsImpl; +import com.azure.resourcemanager.dell.implementation.OperationsImpl; +import com.azure.resourcemanager.dell.implementation.StorageClientBuilder; +import com.azure.resourcemanager.dell.models.FileSystems; +import com.azure.resourcemanager.dell.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to DellManager. + * Dell Storage service. + */ +public final class DellManager { + private Operations operations; + + private FileSystems fileSystems; + + private final StorageClient clientObject; + + private DellManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new StorageClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Dell service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Dell service API instance. + */ + public static DellManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Dell service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Dell service API instance. + */ + public static DellManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DellManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create DellManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DellManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-dell.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Dell service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Dell service API instance. + */ + public DellManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.dell") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new DellManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of FileSystems. It manages FileSystemResource. + * + * @return Resource collection API of FileSystems. + */ + public FileSystems fileSystems() { + if (this.fileSystems == null) { + this.fileSystems = new FileSystemsImpl(clientObject.getFileSystems(), this); + } + return fileSystems; + } + + /** + * Gets wrapped service client StorageClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client StorageClient. + */ + public StorageClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/FileSystemsClient.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/FileSystemsClient.java new file mode 100644 index 000000000000..72e31f158585 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/FileSystemsClient.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dell.fluent.models.FileSystemResourceInner; +import com.azure.resourcemanager.dell.models.FileSystemResourceUpdate; + +/** + * An instance of this class provides access to all the operations defined in FileSystemsClient. + */ +public interface FileSystemsClient { + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String filesystemName, + Context context); + + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileSystemResourceInner getByResourceGroup(String resourceGroupName, String filesystemName); + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileSystemResourceInner> + beginCreateOrUpdate(String resourceGroupName, String filesystemName, FileSystemResourceInner resource); + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileSystemResourceInner> beginCreateOrUpdate( + String resourceGroupName, String filesystemName, FileSystemResourceInner resource, Context context); + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileSystemResourceInner createOrUpdate(String resourceGroupName, String filesystemName, + FileSystemResourceInner resource); + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileSystemResourceInner createOrUpdate(String resourceGroupName, String filesystemName, + FileSystemResourceInner resource, Context context); + + /** + * Update a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String filesystemName, + FileSystemResourceUpdate properties, Context context); + + /** + * Update a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileSystemResourceInner update(String resourceGroupName, String filesystemName, + FileSystemResourceUpdate properties); + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String filesystemName); + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String filesystemName, Context context); + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String filesystemName); + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String filesystemName, Context context); + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List FileSystemResource resources by subscription ID. + * + * @throws com.azure.core.management.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 response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List FileSystemResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/OperationsClient.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/OperationsClient.java new file mode 100644 index 000000000000..c92c549ee822 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dell.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/StorageClient.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/StorageClient.java new file mode 100644 index 000000000000..6e10bc7464d1 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/StorageClient.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for StorageClient class. + */ +public interface StorageClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the FileSystemsClient object to access its operations. + * + * @return the FileSystemsClient object. + */ + FileSystemsClient getFileSystems(); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/FileSystemResourceInner.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/FileSystemResourceInner.java new file mode 100644 index 000000000000..a79bae26f215 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/FileSystemResourceInner.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.dell.models.FileSystemResourceProperties; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class FileSystemResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private FileSystemResourceProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of FileSystemResourceInner class. + */ + public FileSystemResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FileSystemResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the FileSystemResourceInner object itself. + */ + public FileSystemResourceInner withProperties(FileSystemResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the FileSystemResourceInner object itself. + */ + public FileSystemResourceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public FileSystemResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FileSystemResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileSystemResourceInner. + */ + public static FileSystemResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemResourceInner deserializedFileSystemResourceInner = new FileSystemResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileSystemResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileSystemResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileSystemResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFileSystemResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFileSystemResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFileSystemResourceInner.properties = FileSystemResourceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedFileSystemResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFileSystemResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemResourceInner; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/OperationInner.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/OperationInner.java new file mode 100644 index 000000000000..fc2f8f56fdc6 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/OperationInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.dell.models.ActionType; +import com.azure.resourcemanager.dell.models.OperationDisplay; +import com.azure.resourcemanager.dell.models.Origin; +import java.io.IOException; + +/** + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/package-info.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/package-info.java new file mode 100644 index 000000000000..7e1cde02a513 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for Dell. + * Dell Storage service. + */ +package com.azure.resourcemanager.dell.fluent.models; diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/package-info.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/package-info.java new file mode 100644 index 000000000000..d431cab76952 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for Dell. + * Dell Storage service. + */ +package com.azure.resourcemanager.dell.fluent; diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemResourceImpl.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemResourceImpl.java new file mode 100644 index 000000000000..1a77f2899f59 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemResourceImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dell.fluent.models.FileSystemResourceInner; +import com.azure.resourcemanager.dell.models.FileSystemResource; +import com.azure.resourcemanager.dell.models.FileSystemResourceProperties; +import com.azure.resourcemanager.dell.models.FileSystemResourceUpdate; +import com.azure.resourcemanager.dell.models.FileSystemResourceUpdateProperties; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentity; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityUpdate; +import java.util.Collections; +import java.util.Map; + +public final class FileSystemResourceImpl + implements FileSystemResource, FileSystemResource.Definition, FileSystemResource.Update { + private FileSystemResourceInner innerObject; + + private final com.azure.resourcemanager.dell.DellManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public FileSystemResourceProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FileSystemResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dell.DellManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String filesystemName; + + private FileSystemResourceUpdate updateProperties; + + public FileSystemResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public FileSystemResource create() { + this.innerObject = serviceManager.serviceClient() + .getFileSystems() + .createOrUpdate(resourceGroupName, filesystemName, this.innerModel(), Context.NONE); + return this; + } + + public FileSystemResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileSystems() + .createOrUpdate(resourceGroupName, filesystemName, this.innerModel(), context); + return this; + } + + FileSystemResourceImpl(String name, com.azure.resourcemanager.dell.DellManager serviceManager) { + this.innerObject = new FileSystemResourceInner(); + this.serviceManager = serviceManager; + this.filesystemName = name; + } + + public FileSystemResourceImpl update() { + this.updateProperties = new FileSystemResourceUpdate(); + return this; + } + + public FileSystemResource apply() { + this.innerObject = serviceManager.serviceClient() + .getFileSystems() + .updateWithResponse(resourceGroupName, filesystemName, updateProperties, Context.NONE) + .getValue(); + return this; + } + + public FileSystemResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileSystems() + .updateWithResponse(resourceGroupName, filesystemName, updateProperties, context) + .getValue(); + return this; + } + + FileSystemResourceImpl(FileSystemResourceInner innerObject, + com.azure.resourcemanager.dell.DellManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.filesystemName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "filesystems"); + } + + public FileSystemResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getFileSystems() + .getByResourceGroupWithResponse(resourceGroupName, filesystemName, Context.NONE) + .getValue(); + return this; + } + + public FileSystemResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileSystems() + .getByResourceGroupWithResponse(resourceGroupName, filesystemName, context) + .getValue(); + return this; + } + + public FileSystemResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FileSystemResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FileSystemResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public FileSystemResourceImpl withProperties(FileSystemResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public FileSystemResourceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public FileSystemResourceImpl withIdentity(ManagedServiceIdentityUpdate identity) { + this.updateProperties.withIdentity(identity); + return this; + } + + public FileSystemResourceImpl withProperties(FileSystemResourceUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemsClientImpl.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemsClientImpl.java new file mode 100644 index 000000000000..4f35191d3178 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemsClientImpl.java @@ -0,0 +1,1199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dell.fluent.FileSystemsClient; +import com.azure.resourcemanager.dell.fluent.models.FileSystemResourceInner; +import com.azure.resourcemanager.dell.implementation.models.FileSystemResourceListResult; +import com.azure.resourcemanager.dell.models.FileSystemResourceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FileSystemsClient. + */ +public final class FileSystemsClientImpl implements FileSystemsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FileSystemsService service; + + /** + * The service client containing this operation class. + */ + private final StorageClientImpl client; + + /** + * Initializes an instance of FileSystemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileSystemsClientImpl(StorageClientImpl client) { + this.service + = RestProxy.create(FileSystemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageClientFileSystems to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "StorageClientFileSys") + public interface FileSystemsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("filesystemName") String filesystemName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("filesystemName") String filesystemName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileSystemResourceInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("filesystemName") String filesystemName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileSystemResourceUpdate properties, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems/{filesystemName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("filesystemName") String filesystemName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dell.Storage/filesystems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Dell.Storage/filesystems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String filesystemName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filesystemName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String filesystemName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filesystemName, accept, context); + } + + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String filesystemName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, filesystemName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String filesystemName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, filesystemName, context).block(); + } + + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileSystemResourceInner getByResourceGroup(String resourceGroupName, String filesystemName) { + return getByResourceGroupWithResponse(resourceGroupName, filesystemName, Context.NONE).getValue(); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String filesystemName, FileSystemResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filesystemName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String filesystemName, FileSystemResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filesystemName, contentType, accept, resource, context); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FileSystemResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String filesystemName, FileSystemResourceInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, filesystemName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FileSystemResourceInner.class, FileSystemResourceInner.class, + this.client.getContext()); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FileSystemResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String filesystemName, FileSystemResourceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, filesystemName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FileSystemResourceInner.class, FileSystemResourceInner.class, context); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileSystemResourceInner> + beginCreateOrUpdate(String resourceGroupName, String filesystemName, FileSystemResourceInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, filesystemName, resource).getSyncPoller(); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileSystemResourceInner> beginCreateOrUpdate( + String resourceGroupName, String filesystemName, FileSystemResourceInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, filesystemName, resource, context).getSyncPoller(); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String filesystemName, + FileSystemResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, filesystemName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String filesystemName, + FileSystemResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, filesystemName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileSystemResourceInner createOrUpdate(String resourceGroupName, String filesystemName, + FileSystemResourceInner resource) { + return createOrUpdateAsync(resourceGroupName, filesystemName, resource).block(); + } + + /** + * Create a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileSystemResourceInner createOrUpdate(String resourceGroupName, String filesystemName, + FileSystemResourceInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, filesystemName, resource, context).block(); + } + + /** + * Update a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String filesystemName, FileSystemResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filesystemName, contentType, accept, properties, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String filesystemName, FileSystemResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filesystemName, contentType, accept, properties, context); + } + + /** + * Update a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String filesystemName, + FileSystemResourceUpdate properties) { + return updateWithResponseAsync(resourceGroupName, filesystemName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String filesystemName, + FileSystemResourceUpdate properties, Context context) { + return updateWithResponseAsync(resourceGroupName, filesystemName, properties, context).block(); + } + + /** + * Update a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileSystemResourceInner update(String resourceGroupName, String filesystemName, + FileSystemResourceUpdate properties) { + return updateWithResponse(resourceGroupName, filesystemName, properties, Context.NONE).getValue(); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String filesystemName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filesystemName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String filesystemName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (filesystemName == null) { + return Mono.error(new IllegalArgumentException("Parameter filesystemName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filesystemName, accept, context); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String filesystemName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, filesystemName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String filesystemName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, filesystemName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String filesystemName) { + return this.beginDeleteAsync(resourceGroupName, filesystemName).getSyncPoller(); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String filesystemName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, filesystemName, context).getSyncPoller(); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String filesystemName) { + return beginDeleteAsync(resourceGroupName, filesystemName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String filesystemName, Context context) { + return beginDeleteAsync(resourceGroupName, filesystemName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String filesystemName) { + deleteAsync(resourceGroupName, filesystemName).block(); + } + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String filesystemName, Context context) { + deleteAsync(resourceGroupName, filesystemName, context).block(); + } + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a FileSystemResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List FileSystemResource resources by subscription ID. + * + * @throws 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 response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List FileSystemResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List FileSystemResource resources by subscription ID. + * + * @throws 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 response of a FileSystemResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List FileSystemResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List FileSystemResource resources by subscription ID. + * + * @throws 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 response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List FileSystemResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemsImpl.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemsImpl.java new file mode 100644 index 000000000000..1008cc74c3ba --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/FileSystemsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dell.fluent.FileSystemsClient; +import com.azure.resourcemanager.dell.fluent.models.FileSystemResourceInner; +import com.azure.resourcemanager.dell.models.FileSystemResource; +import com.azure.resourcemanager.dell.models.FileSystems; + +public final class FileSystemsImpl implements FileSystems { + private static final ClientLogger LOGGER = new ClientLogger(FileSystemsImpl.class); + + private final FileSystemsClient innerClient; + + private final com.azure.resourcemanager.dell.DellManager serviceManager; + + public FileSystemsImpl(FileSystemsClient innerClient, com.azure.resourcemanager.dell.DellManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String filesystemName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, filesystemName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileSystemResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileSystemResource getByResourceGroup(String resourceGroupName, String filesystemName) { + FileSystemResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, filesystemName); + if (inner != null) { + return new FileSystemResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String filesystemName) { + this.serviceClient().delete(resourceGroupName, filesystemName); + } + + public void delete(String resourceGroupName, String filesystemName, Context context) { + this.serviceClient().delete(resourceGroupName, filesystemName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileSystemResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileSystemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileSystemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileSystemResourceImpl(inner1, this.manager())); + } + + public FileSystemResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String filesystemName = ResourceManagerUtils.getValueFromIdByName(id, "filesystems"); + if (filesystemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'filesystems'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, filesystemName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String filesystemName = ResourceManagerUtils.getValueFromIdByName(id, "filesystems"); + if (filesystemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'filesystems'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, filesystemName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String filesystemName = ResourceManagerUtils.getValueFromIdByName(id, "filesystems"); + if (filesystemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'filesystems'.", id))); + } + this.delete(resourceGroupName, filesystemName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String filesystemName = ResourceManagerUtils.getValueFromIdByName(id, "filesystems"); + if (filesystemName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'filesystems'.", id))); + } + this.delete(resourceGroupName, filesystemName, context); + } + + private FileSystemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dell.DellManager manager() { + return this.serviceManager; + } + + public FileSystemResourceImpl define(String name) { + return new FileSystemResourceImpl(name, this.manager()); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationImpl.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationImpl.java new file mode 100644 index 000000000000..689c7757e837 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.resourcemanager.dell.fluent.models.OperationInner; +import com.azure.resourcemanager.dell.models.ActionType; +import com.azure.resourcemanager.dell.models.Operation; +import com.azure.resourcemanager.dell.models.OperationDisplay; +import com.azure.resourcemanager.dell.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.dell.DellManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.dell.DellManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dell.DellManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationsClientImpl.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..499c69bf061e --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationsClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.dell.fluent.OperationsClient; +import com.azure.resourcemanager.dell.fluent.models.OperationInner; +import com.azure.resourcemanager.dell.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final StorageClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(StorageClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageClientOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "StorageClientOperati") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Dell.Storage/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationsImpl.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationsImpl.java new file mode 100644 index 000000000000..2a510d40f209 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/OperationsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.dell.fluent.OperationsClient; +import com.azure.resourcemanager.dell.fluent.models.OperationInner; +import com.azure.resourcemanager.dell.models.Operation; +import com.azure.resourcemanager.dell.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.dell.DellManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.dell.DellManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dell.DellManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/ResourceManagerUtils.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..91df1d381f6b --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/StorageClientBuilder.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/StorageClientBuilder.java new file mode 100644 index 000000000000..e2a2d635eacc --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/StorageClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the StorageClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { StorageClientImpl.class }) +public final class StorageClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the StorageClientBuilder. + */ + public StorageClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the StorageClientBuilder. + */ + public StorageClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the StorageClientBuilder. + */ + public StorageClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the StorageClientBuilder. + */ + public StorageClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the StorageClientBuilder. + */ + public StorageClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the StorageClientBuilder. + */ + public StorageClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of StorageClientImpl with the provided parameters. + * + * @return an instance of StorageClientImpl. + */ + public StorageClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + StorageClientImpl client = new StorageClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/StorageClientImpl.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/StorageClientImpl.java new file mode 100644 index 000000000000..9c4f6707b6ae --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/StorageClientImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.dell.fluent.FileSystemsClient; +import com.azure.resourcemanager.dell.fluent.OperationsClient; +import com.azure.resourcemanager.dell.fluent.StorageClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the StorageClientImpl type. + */ +@ServiceClient(builder = StorageClientBuilder.class) +public final class StorageClientImpl implements StorageClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The FileSystemsClient object to access its operations. + */ + private final FileSystemsClient fileSystems; + + /** + * Gets the FileSystemsClient object to access its operations. + * + * @return the FileSystemsClient object. + */ + public FileSystemsClient getFileSystems() { + return this.fileSystems; + } + + /** + * Initializes an instance of StorageClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + StorageClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-03-21-preview"; + this.operations = new OperationsClientImpl(this); + this.fileSystems = new FileSystemsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageClientImpl.class); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/models/FileSystemResourceListResult.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/models/FileSystemResourceListResult.java new file mode 100644 index 000000000000..152cfe471e76 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/models/FileSystemResourceListResult.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.dell.fluent.models.FileSystemResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a FileSystemResource list operation. + */ +@Immutable +public final class FileSystemResourceListResult implements JsonSerializable { + /* + * The FileSystemResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FileSystemResourceListResult class. + */ + private FileSystemResourceListResult() { + } + + /** + * Get the value property: The FileSystemResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model FileSystemResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FileSystemResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileSystemResourceListResult. + */ + public static FileSystemResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemResourceListResult deserializedFileSystemResourceListResult = new FileSystemResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FileSystemResourceInner.fromJson(reader1)); + deserializedFileSystemResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFileSystemResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemResourceListResult; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/models/OperationListResult.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..3e1f687c04a1 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/models/OperationListResult.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.dell.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/package-info.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/package-info.java new file mode 100644 index 000000000000..636b47dfb37d --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for Dell. + * Dell Storage service. + */ +package com.azure.resourcemanager.dell.implementation; diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ActionType.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ActionType.java new file mode 100644 index 000000000000..3337172aa477 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Capacity.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Capacity.java new file mode 100644 index 000000000000..cb922928393c --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Capacity.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Capacity for a Resource. + */ +@Fluent +public final class Capacity implements JsonSerializable { + /* + * Minimum Capacity + */ + private String min; + + /* + * Maximum Capacity + */ + private String max; + + /* + * Units to be increased + */ + private String incremental; + + /* + * Current Capacity of the resource + */ + private String current; + + /** + * Creates an instance of Capacity class. + */ + public Capacity() { + } + + /** + * Get the min property: Minimum Capacity. + * + * @return the min value. + */ + public String min() { + return this.min; + } + + /** + * Set the min property: Minimum Capacity. + * + * @param min the min value to set. + * @return the Capacity object itself. + */ + public Capacity withMin(String min) { + this.min = min; + return this; + } + + /** + * Get the max property: Maximum Capacity. + * + * @return the max value. + */ + public String max() { + return this.max; + } + + /** + * Set the max property: Maximum Capacity. + * + * @param max the max value to set. + * @return the Capacity object itself. + */ + public Capacity withMax(String max) { + this.max = max; + return this; + } + + /** + * Get the incremental property: Units to be increased. + * + * @return the incremental value. + */ + public String incremental() { + return this.incremental; + } + + /** + * Set the incremental property: Units to be increased. + * + * @param incremental the incremental value to set. + * @return the Capacity object itself. + */ + public Capacity withIncremental(String incremental) { + this.incremental = incremental; + return this; + } + + /** + * Get the current property: Current Capacity of the resource. + * + * @return the current value. + */ + public String current() { + return this.current; + } + + /** + * Set the current property: Current Capacity of the resource. + * + * @param current the current value to set. + * @return the Capacity object itself. + */ + public Capacity withCurrent(String current) { + this.current = current; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("min", this.min); + jsonWriter.writeStringField("max", this.max); + jsonWriter.writeStringField("incremental", this.incremental); + jsonWriter.writeStringField("current", this.current); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Capacity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Capacity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Capacity. + */ + public static Capacity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Capacity deserializedCapacity = new Capacity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("min".equals(fieldName)) { + deserializedCapacity.min = reader.getString(); + } else if ("max".equals(fieldName)) { + deserializedCapacity.max = reader.getString(); + } else if ("incremental".equals(fieldName)) { + deserializedCapacity.incremental = reader.getString(); + } else if ("current".equals(fieldName)) { + deserializedCapacity.current = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacity; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityProperties.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityProperties.java new file mode 100644 index 000000000000..f6c3fc91c4ee --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * EncryptionIdentityProperties of Dell FileSystem resource. + */ +@Fluent +public final class EncryptionIdentityProperties implements JsonSerializable { + /* + * Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now + */ + private EncryptionIdentityType identityType; + + /* + * User-assigned identity resource id - Only when user opts for UserAssigned identity and hence optional + */ + private String identityResourceId; + + /** + * Creates an instance of EncryptionIdentityProperties class. + */ + public EncryptionIdentityProperties() { + } + + /** + * Get the identityType property: Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + * + * @return the identityType value. + */ + public EncryptionIdentityType identityType() { + return this.identityType; + } + + /** + * Set the identityType property: Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + * + * @param identityType the identityType value to set. + * @return the EncryptionIdentityProperties object itself. + */ + public EncryptionIdentityProperties withIdentityType(EncryptionIdentityType identityType) { + this.identityType = identityType; + return this; + } + + /** + * Get the identityResourceId property: User-assigned identity resource id - Only when user opts for UserAssigned + * identity and hence optional. + * + * @return the identityResourceId value. + */ + public String identityResourceId() { + return this.identityResourceId; + } + + /** + * Set the identityResourceId property: User-assigned identity resource id - Only when user opts for UserAssigned + * identity and hence optional. + * + * @param identityResourceId the identityResourceId value to set. + * @return the EncryptionIdentityProperties object itself. + */ + public EncryptionIdentityProperties withIdentityResourceId(String identityResourceId) { + this.identityResourceId = identityResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identityType", this.identityType == null ? null : this.identityType.toString()); + jsonWriter.writeStringField("identityResourceId", this.identityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionIdentityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionIdentityProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionIdentityProperties. + */ + public static EncryptionIdentityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionIdentityProperties deserializedEncryptionIdentityProperties = new EncryptionIdentityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedEncryptionIdentityProperties.identityType + = EncryptionIdentityType.fromString(reader.getString()); + } else if ("identityResourceId".equals(fieldName)) { + deserializedEncryptionIdentityProperties.identityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionIdentityProperties; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityType.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityType.java new file mode 100644 index 000000000000..bec16f15f278 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Identity type of ManagedIdentity Associated with Dell FileSystem resource. + */ +public final class EncryptionIdentityType extends ExpandableStringEnum { + /** + * System Assigned Managed identity. + */ + public static final EncryptionIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User Assigned managed identity. + */ + public static final EncryptionIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates a new instance of EncryptionIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionIdentityType() { + } + + /** + * Creates or finds a EncryptionIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionIdentityType. + */ + public static EncryptionIdentityType fromString(String name) { + return fromString(name, EncryptionIdentityType.class); + } + + /** + * Gets known EncryptionIdentityType values. + * + * @return known EncryptionIdentityType values. + */ + public static Collection values() { + return values(EncryptionIdentityType.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityUpdateProperties.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityUpdateProperties.java new file mode 100644 index 000000000000..17bfb8978b70 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionIdentityUpdateProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * EncryptionIdentityUpdateProperties of Dell FileSystem resource. + */ +@Fluent +public final class EncryptionIdentityUpdateProperties implements JsonSerializable { + /* + * Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now + */ + private EncryptionIdentityType identityType; + + /* + * User-assigned identity resource id - Only when user opts for UserAssigned identity and hence optional + */ + private String identityResourceId; + + /** + * Creates an instance of EncryptionIdentityUpdateProperties class. + */ + public EncryptionIdentityUpdateProperties() { + } + + /** + * Get the identityType property: Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + * + * @return the identityType value. + */ + public EncryptionIdentityType identityType() { + return this.identityType; + } + + /** + * Set the identityType property: Identity type - SystemAssigned/UserAssigned - Only UserAssigned is supported now. + * + * @param identityType the identityType value to set. + * @return the EncryptionIdentityUpdateProperties object itself. + */ + public EncryptionIdentityUpdateProperties withIdentityType(EncryptionIdentityType identityType) { + this.identityType = identityType; + return this; + } + + /** + * Get the identityResourceId property: User-assigned identity resource id - Only when user opts for UserAssigned + * identity and hence optional. + * + * @return the identityResourceId value. + */ + public String identityResourceId() { + return this.identityResourceId; + } + + /** + * Set the identityResourceId property: User-assigned identity resource id - Only when user opts for UserAssigned + * identity and hence optional. + * + * @param identityResourceId the identityResourceId value to set. + * @return the EncryptionIdentityUpdateProperties object itself. + */ + public EncryptionIdentityUpdateProperties withIdentityResourceId(String identityResourceId) { + this.identityResourceId = identityResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identityType", this.identityType == null ? null : this.identityType.toString()); + jsonWriter.writeStringField("identityResourceId", this.identityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionIdentityUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionIdentityUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionIdentityUpdateProperties. + */ + public static EncryptionIdentityUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionIdentityUpdateProperties deserializedEncryptionIdentityUpdateProperties + = new EncryptionIdentityUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityType".equals(fieldName)) { + deserializedEncryptionIdentityUpdateProperties.identityType + = EncryptionIdentityType.fromString(reader.getString()); + } else if ("identityResourceId".equals(fieldName)) { + deserializedEncryptionIdentityUpdateProperties.identityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionIdentityUpdateProperties; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionProperties.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionProperties.java new file mode 100644 index 000000000000..5e095783fffb --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * EncryptionProperties of Dell FileSystem resource. + */ +@Fluent +public final class EncryptionProperties implements JsonSerializable { + /* + * Encryption Type - MMK/CMK + */ + private ResourceEncryptionType encryptionType; + + /* + * Versioned Encryption Key Url - Only when user opts for CMK and hence optional + */ + private String keyUrl; + + /* + * Identity configuration for Customer-managed key settings defining which identity should be used to auth to Key + * Vault - Only when user opts for CMK and hence optional + */ + private EncryptionIdentityProperties encryptionIdentityProperties; + + /** + * Creates an instance of EncryptionProperties class. + */ + public EncryptionProperties() { + } + + /** + * Get the encryptionType property: Encryption Type - MMK/CMK. + * + * @return the encryptionType value. + */ + public ResourceEncryptionType encryptionType() { + return this.encryptionType; + } + + /** + * Set the encryptionType property: Encryption Type - MMK/CMK. + * + * @param encryptionType the encryptionType value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withEncryptionType(ResourceEncryptionType encryptionType) { + this.encryptionType = encryptionType; + return this; + } + + /** + * Get the keyUrl property: Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + * + * @param keyUrl the keyUrl value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Get the encryptionIdentityProperties property: Identity configuration for Customer-managed key settings defining + * which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + * + * @return the encryptionIdentityProperties value. + */ + public EncryptionIdentityProperties encryptionIdentityProperties() { + return this.encryptionIdentityProperties; + } + + /** + * Set the encryptionIdentityProperties property: Identity configuration for Customer-managed key settings defining + * which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + * + * @param encryptionIdentityProperties the encryptionIdentityProperties value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties + withEncryptionIdentityProperties(EncryptionIdentityProperties encryptionIdentityProperties) { + this.encryptionIdentityProperties = encryptionIdentityProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property encryptionType in model EncryptionProperties")); + } + if (encryptionIdentityProperties() != null) { + encryptionIdentityProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("encryptionType", + this.encryptionType == null ? null : this.encryptionType.toString()); + jsonWriter.writeStringField("keyUrl", this.keyUrl); + jsonWriter.writeJsonField("encryptionIdentityProperties", this.encryptionIdentityProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EncryptionProperties. + */ + public static EncryptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionProperties deserializedEncryptionProperties = new EncryptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryptionType".equals(fieldName)) { + deserializedEncryptionProperties.encryptionType + = ResourceEncryptionType.fromString(reader.getString()); + } else if ("keyUrl".equals(fieldName)) { + deserializedEncryptionProperties.keyUrl = reader.getString(); + } else if ("encryptionIdentityProperties".equals(fieldName)) { + deserializedEncryptionProperties.encryptionIdentityProperties + = EncryptionIdentityProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionProperties; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionUpdateProperties.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionUpdateProperties.java new file mode 100644 index 000000000000..ddc44c9ef633 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/EncryptionUpdateProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * EncryptionUpdateProperties of Dell FileSystem resource. + */ +@Fluent +public final class EncryptionUpdateProperties implements JsonSerializable { + /* + * Encryption Type - MMK/CMK + */ + private ResourceEncryptionType encryptionType; + + /* + * Versioned Encryption Key Url - Only when user opts for CMK and hence optional + */ + private String keyUrl; + + /* + * Identity configuration for Customer-managed key settings defining which identity should be used to auth to Key + * Vault - Only when user opts for CMK and hence optional + */ + private EncryptionIdentityUpdateProperties encryptionIdentityProperties; + + /** + * Creates an instance of EncryptionUpdateProperties class. + */ + public EncryptionUpdateProperties() { + } + + /** + * Get the encryptionType property: Encryption Type - MMK/CMK. + * + * @return the encryptionType value. + */ + public ResourceEncryptionType encryptionType() { + return this.encryptionType; + } + + /** + * Set the encryptionType property: Encryption Type - MMK/CMK. + * + * @param encryptionType the encryptionType value to set. + * @return the EncryptionUpdateProperties object itself. + */ + public EncryptionUpdateProperties withEncryptionType(ResourceEncryptionType encryptionType) { + this.encryptionType = encryptionType; + return this; + } + + /** + * Get the keyUrl property: Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + * + * @return the keyUrl value. + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set the keyUrl property: Versioned Encryption Key Url - Only when user opts for CMK and hence optional. + * + * @param keyUrl the keyUrl value to set. + * @return the EncryptionUpdateProperties object itself. + */ + public EncryptionUpdateProperties withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Get the encryptionIdentityProperties property: Identity configuration for Customer-managed key settings defining + * which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + * + * @return the encryptionIdentityProperties value. + */ + public EncryptionIdentityUpdateProperties encryptionIdentityProperties() { + return this.encryptionIdentityProperties; + } + + /** + * Set the encryptionIdentityProperties property: Identity configuration for Customer-managed key settings defining + * which identity should be used to auth to Key Vault - Only when user opts for CMK and hence optional. + * + * @param encryptionIdentityProperties the encryptionIdentityProperties value to set. + * @return the EncryptionUpdateProperties object itself. + */ + public EncryptionUpdateProperties + withEncryptionIdentityProperties(EncryptionIdentityUpdateProperties encryptionIdentityProperties) { + this.encryptionIdentityProperties = encryptionIdentityProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionIdentityProperties() != null) { + encryptionIdentityProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("encryptionType", + this.encryptionType == null ? null : this.encryptionType.toString()); + jsonWriter.writeStringField("keyUrl", this.keyUrl); + jsonWriter.writeJsonField("encryptionIdentityProperties", this.encryptionIdentityProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionUpdateProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionUpdateProperties. + */ + public static EncryptionUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionUpdateProperties deserializedEncryptionUpdateProperties = new EncryptionUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryptionType".equals(fieldName)) { + deserializedEncryptionUpdateProperties.encryptionType + = ResourceEncryptionType.fromString(reader.getString()); + } else if ("keyUrl".equals(fieldName)) { + deserializedEncryptionUpdateProperties.keyUrl = reader.getString(); + } else if ("encryptionIdentityProperties".equals(fieldName)) { + deserializedEncryptionUpdateProperties.encryptionIdentityProperties + = EncryptionIdentityUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionUpdateProperties; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResource.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResource.java new file mode 100644 index 000000000000..ce5535892abe --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResource.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dell.fluent.models.FileSystemResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of FileSystemResource. + */ +public interface FileSystemResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + FileSystemResourceProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.dell.fluent.models.FileSystemResourceInner object. + * + * @return the inner object. + */ + FileSystemResourceInner innerModel(); + + /** + * The entirety of the FileSystemResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The FileSystemResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FileSystemResource definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the FileSystemResource definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the FileSystemResource definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the FileSystemResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileSystemResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileSystemResource create(Context context); + } + + /** + * The stage of the FileSystemResource definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the FileSystemResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(FileSystemResourceProperties properties); + } + + /** + * The stage of the FileSystemResource definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Begins update for the FileSystemResource resource. + * + * @return the stage of resource update. + */ + FileSystemResource.Update update(); + + /** + * The template for FileSystemResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FileSystemResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FileSystemResource apply(Context context); + } + + /** + * The FileSystemResource update stages. + */ + interface UpdateStages { + /** + * The stage of the FileSystemResource update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the FileSystemResource update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentityUpdate identity); + } + + /** + * The stage of the FileSystemResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The updatable properties of the FileSystemResource.. + * + * @param properties The updatable properties of the FileSystemResource. + * @return the next definition stage. + */ + Update withProperties(FileSystemResourceUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileSystemResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileSystemResource refresh(Context context); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceProperties.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceProperties.java new file mode 100644 index 000000000000..4a1b8c010b7d --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceProperties.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties specific to the Dell File System resource. + */ +@Fluent +public final class FileSystemResourceProperties implements JsonSerializable { + /* + * Capacity for Dell Filesystem, Will be received as part of Job Status + */ + private Capacity capacity; + + /* + * Marketplace details + */ + private MarketplaceDetails marketplace; + + /* + * Provisioning State of the resource + */ + private ProvisioningState provisioningState; + + /* + * Delegated subnet id for Vnet injection + */ + private String delegatedSubnetId; + + /* + * Domain range for the delegated subnet + */ + private String delegatedSubnetCidr; + + /* + * User Details + */ + private UserDetails user; + + /* + * File system Id of the resource + */ + private String fileSystemId; + + /* + * Smart Connect FQDN of the resource + */ + private String smartConnectFqdn; + + /* + * DellReferenceNumber of the resource + */ + private String dellReferenceNumber; + + /* + * EncryptionProperties of the resource + */ + private EncryptionProperties encryption; + + /** + * Creates an instance of FileSystemResourceProperties class. + */ + public FileSystemResourceProperties() { + } + + /** + * Get the capacity property: Capacity for Dell Filesystem, Will be received as part of Job Status. + * + * @return the capacity value. + */ + public Capacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Capacity for Dell Filesystem, Will be received as part of Job Status. + * + * @param capacity the capacity value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withCapacity(Capacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the marketplace property: Marketplace details. + * + * @return the marketplace value. + */ + public MarketplaceDetails marketplace() { + return this.marketplace; + } + + /** + * Set the marketplace property: Marketplace details. + * + * @param marketplace the marketplace value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withMarketplace(MarketplaceDetails marketplace) { + this.marketplace = marketplace; + return this; + } + + /** + * Get the provisioningState property: Provisioning State of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the delegatedSubnetId property: Delegated subnet id for Vnet injection. + * + * @return the delegatedSubnetId value. + */ + public String delegatedSubnetId() { + return this.delegatedSubnetId; + } + + /** + * Set the delegatedSubnetId property: Delegated subnet id for Vnet injection. + * + * @param delegatedSubnetId the delegatedSubnetId value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withDelegatedSubnetId(String delegatedSubnetId) { + this.delegatedSubnetId = delegatedSubnetId; + return this; + } + + /** + * Get the delegatedSubnetCidr property: Domain range for the delegated subnet. + * + * @return the delegatedSubnetCidr value. + */ + public String delegatedSubnetCidr() { + return this.delegatedSubnetCidr; + } + + /** + * Set the delegatedSubnetCidr property: Domain range for the delegated subnet. + * + * @param delegatedSubnetCidr the delegatedSubnetCidr value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withDelegatedSubnetCidr(String delegatedSubnetCidr) { + this.delegatedSubnetCidr = delegatedSubnetCidr; + return this; + } + + /** + * Get the user property: User Details. + * + * @return the user value. + */ + public UserDetails user() { + return this.user; + } + + /** + * Set the user property: User Details. + * + * @param user the user value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withUser(UserDetails user) { + this.user = user; + return this; + } + + /** + * Get the fileSystemId property: File system Id of the resource. + * + * @return the fileSystemId value. + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set the fileSystemId property: File system Id of the resource. + * + * @param fileSystemId the fileSystemId value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the smartConnectFqdn property: Smart Connect FQDN of the resource. + * + * @return the smartConnectFqdn value. + */ + public String smartConnectFqdn() { + return this.smartConnectFqdn; + } + + /** + * Set the smartConnectFqdn property: Smart Connect FQDN of the resource. + * + * @param smartConnectFqdn the smartConnectFqdn value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withSmartConnectFqdn(String smartConnectFqdn) { + this.smartConnectFqdn = smartConnectFqdn; + return this; + } + + /** + * Get the dellReferenceNumber property: DellReferenceNumber of the resource. + * + * @return the dellReferenceNumber value. + */ + public String dellReferenceNumber() { + return this.dellReferenceNumber; + } + + /** + * Set the dellReferenceNumber property: DellReferenceNumber of the resource. + * + * @param dellReferenceNumber the dellReferenceNumber value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withDellReferenceNumber(String dellReferenceNumber) { + this.dellReferenceNumber = dellReferenceNumber; + return this; + } + + /** + * Get the encryption property: EncryptionProperties of the resource. + * + * @return the encryption value. + */ + public EncryptionProperties encryption() { + return this.encryption; + } + + /** + * Set the encryption property: EncryptionProperties of the resource. + * + * @param encryption the encryption value to set. + * @return the FileSystemResourceProperties object itself. + */ + public FileSystemResourceProperties withEncryption(EncryptionProperties encryption) { + this.encryption = encryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (marketplace() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property marketplace in model FileSystemResourceProperties")); + } else { + marketplace().validate(); + } + if (delegatedSubnetId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property delegatedSubnetId in model FileSystemResourceProperties")); + } + if (delegatedSubnetCidr() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property delegatedSubnetCidr in model FileSystemResourceProperties")); + } + if (user() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property user in model FileSystemResourceProperties")); + } else { + user().validate(); + } + if (dellReferenceNumber() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dellReferenceNumber in model FileSystemResourceProperties")); + } + if (encryption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property encryption in model FileSystemResourceProperties")); + } else { + encryption().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FileSystemResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("marketplace", this.marketplace); + jsonWriter.writeStringField("delegatedSubnetId", this.delegatedSubnetId); + jsonWriter.writeStringField("delegatedSubnetCidr", this.delegatedSubnetCidr); + jsonWriter.writeJsonField("user", this.user); + jsonWriter.writeStringField("dellReferenceNumber", this.dellReferenceNumber); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeStringField("fileSystemId", this.fileSystemId); + jsonWriter.writeStringField("smartConnectFqdn", this.smartConnectFqdn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileSystemResourceProperties. + */ + public static FileSystemResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemResourceProperties deserializedFileSystemResourceProperties = new FileSystemResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("marketplace".equals(fieldName)) { + deserializedFileSystemResourceProperties.marketplace = MarketplaceDetails.fromJson(reader); + } else if ("delegatedSubnetId".equals(fieldName)) { + deserializedFileSystemResourceProperties.delegatedSubnetId = reader.getString(); + } else if ("delegatedSubnetCidr".equals(fieldName)) { + deserializedFileSystemResourceProperties.delegatedSubnetCidr = reader.getString(); + } else if ("user".equals(fieldName)) { + deserializedFileSystemResourceProperties.user = UserDetails.fromJson(reader); + } else if ("dellReferenceNumber".equals(fieldName)) { + deserializedFileSystemResourceProperties.dellReferenceNumber = reader.getString(); + } else if ("encryption".equals(fieldName)) { + deserializedFileSystemResourceProperties.encryption = EncryptionProperties.fromJson(reader); + } else if ("capacity".equals(fieldName)) { + deserializedFileSystemResourceProperties.capacity = Capacity.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedFileSystemResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("fileSystemId".equals(fieldName)) { + deserializedFileSystemResourceProperties.fileSystemId = reader.getString(); + } else if ("smartConnectFqdn".equals(fieldName)) { + deserializedFileSystemResourceProperties.smartConnectFqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemResourceProperties; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceUpdate.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceUpdate.java new file mode 100644 index 000000000000..e84f3e41d7f0 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceUpdate.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for update operations of the FileSystemResource. + */ +@Fluent +public final class FileSystemResourceUpdate implements JsonSerializable { + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentityUpdate identity; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The updatable properties of the FileSystemResource. + */ + private FileSystemResourceUpdateProperties properties; + + /** + * Creates an instance of FileSystemResourceUpdate class. + */ + public FileSystemResourceUpdate() { + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentityUpdate identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the FileSystemResourceUpdate object itself. + */ + public FileSystemResourceUpdate withIdentity(ManagedServiceIdentityUpdate identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the FileSystemResourceUpdate object itself. + */ + public FileSystemResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The updatable properties of the FileSystemResource. + * + * @return the properties value. + */ + public FileSystemResourceUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The updatable properties of the FileSystemResource. + * + * @param properties the properties value to set. + * @return the FileSystemResourceUpdate object itself. + */ + public FileSystemResourceUpdate withProperties(FileSystemResourceUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemResourceUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSystemResourceUpdate. + */ + public static FileSystemResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemResourceUpdate deserializedFileSystemResourceUpdate = new FileSystemResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedFileSystemResourceUpdate.identity = ManagedServiceIdentityUpdate.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFileSystemResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedFileSystemResourceUpdate.properties + = FileSystemResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemResourceUpdate; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceUpdateProperties.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceUpdateProperties.java new file mode 100644 index 000000000000..caf4e960cc1e --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystemResourceUpdateProperties.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The updatable properties of the FileSystemResource. + */ +@Fluent +public final class FileSystemResourceUpdateProperties implements JsonSerializable { + /* + * Delegated subnet id for Vnet injection + */ + private String delegatedSubnetId; + + /* + * Capacity for Dell Filesystem + */ + private Capacity capacity; + + /* + * Encryption Details of the resource + */ + private EncryptionUpdateProperties encryption; + + /** + * Creates an instance of FileSystemResourceUpdateProperties class. + */ + public FileSystemResourceUpdateProperties() { + } + + /** + * Get the delegatedSubnetId property: Delegated subnet id for Vnet injection. + * + * @return the delegatedSubnetId value. + */ + public String delegatedSubnetId() { + return this.delegatedSubnetId; + } + + /** + * Set the delegatedSubnetId property: Delegated subnet id for Vnet injection. + * + * @param delegatedSubnetId the delegatedSubnetId value to set. + * @return the FileSystemResourceUpdateProperties object itself. + */ + public FileSystemResourceUpdateProperties withDelegatedSubnetId(String delegatedSubnetId) { + this.delegatedSubnetId = delegatedSubnetId; + return this; + } + + /** + * Get the capacity property: Capacity for Dell Filesystem. + * + * @return the capacity value. + */ + public Capacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Capacity for Dell Filesystem. + * + * @param capacity the capacity value to set. + * @return the FileSystemResourceUpdateProperties object itself. + */ + public FileSystemResourceUpdateProperties withCapacity(Capacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the encryption property: Encryption Details of the resource. + * + * @return the encryption value. + */ + public EncryptionUpdateProperties encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption Details of the resource. + * + * @param encryption the encryption value to set. + * @return the FileSystemResourceUpdateProperties object itself. + */ + public FileSystemResourceUpdateProperties withEncryption(EncryptionUpdateProperties encryption) { + this.encryption = encryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("delegatedSubnetId", this.delegatedSubnetId); + jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeJsonField("encryption", this.encryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemResourceUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSystemResourceUpdateProperties. + */ + public static FileSystemResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemResourceUpdateProperties deserializedFileSystemResourceUpdateProperties + = new FileSystemResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("delegatedSubnetId".equals(fieldName)) { + deserializedFileSystemResourceUpdateProperties.delegatedSubnetId = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedFileSystemResourceUpdateProperties.capacity = Capacity.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedFileSystemResourceUpdateProperties.encryption + = EncryptionUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemResourceUpdateProperties; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystems.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystems.java new file mode 100644 index 000000000000..08b86bb5082a --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/FileSystems.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FileSystems. + */ +public interface FileSystems { + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String filesystemName, + Context context); + + /** + * Get a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource. + */ + FileSystemResource getByResourceGroup(String resourceGroupName, String filesystemName); + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String filesystemName); + + /** + * Delete a FileSystemResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filesystemName Name of the filesystem resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String filesystemName, Context context); + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List FileSystemResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List FileSystemResource resources by subscription ID. + * + * @throws com.azure.core.management.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 response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List FileSystemResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileSystemResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get a FileSystemResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource along with {@link Response}. + */ + FileSystemResource getById(String id); + + /** + * Get a FileSystemResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FileSystemResource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a FileSystemResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a FileSystemResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FileSystemResource resource. + * + * @param name resource name. + * @return the first stage of the new FileSystemResource definition. + */ + FileSystemResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentity.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..11ed36da4670 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentity.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentityType.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..952d9e320b08 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentityUpdate.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentityUpdate.java new file mode 100644 index 000000000000..58c3380b7c5d --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ManagedServiceIdentityUpdate.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentityUpdate implements JsonSerializable { + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentityUpdate class. + */ + public ManagedServiceIdentityUpdate() { + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentityUpdate object itself. + */ + public ManagedServiceIdentityUpdate withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentityUpdate object itself. + */ + public ManagedServiceIdentityUpdate + withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentityUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentityUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedServiceIdentityUpdate. + */ + public static ManagedServiceIdentityUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentityUpdate deserializedManagedServiceIdentityUpdate = new ManagedServiceIdentityUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentityUpdate.type + = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentityUpdate.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentityUpdate; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/MarketplaceDetails.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/MarketplaceDetails.java new file mode 100644 index 000000000000..e8df2e7911d4 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/MarketplaceDetails.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * MarketplaceDetails of Dell FileSystem resource. + */ +@Fluent +public final class MarketplaceDetails implements JsonSerializable { + /* + * Marketplace Subscription Id + */ + private String marketplaceSubscriptionId; + + /* + * Plan Id + */ + private String planId; + + /* + * Offer Id + */ + private String offerId; + + /* + * Publisher Id + */ + private String publisherId; + + /* + * Private Offer Id + */ + private String privateOfferId; + + /* + * Plan Name + */ + private String planName; + + /* + * Marketplace subscription status + */ + private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; + + /* + * End Date of the subscription + */ + private String endDate; + + /** + * Creates an instance of MarketplaceDetails class. + */ + public MarketplaceDetails() { + } + + /** + * Get the marketplaceSubscriptionId property: Marketplace Subscription Id. + * + * @return the marketplaceSubscriptionId value. + */ + public String marketplaceSubscriptionId() { + return this.marketplaceSubscriptionId; + } + + /** + * Set the marketplaceSubscriptionId property: Marketplace Subscription Id. + * + * @param marketplaceSubscriptionId the marketplaceSubscriptionId value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withMarketplaceSubscriptionId(String marketplaceSubscriptionId) { + this.marketplaceSubscriptionId = marketplaceSubscriptionId; + return this; + } + + /** + * Get the planId property: Plan Id. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: Plan Id. + * + * @param planId the planId value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the offerId property: Offer Id. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: Offer Id. + * + * @param offerId the offerId value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Get the publisherId property: Publisher Id. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Publisher Id. + * + * @param publisherId the publisherId value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the privateOfferId property: Private Offer Id. + * + * @return the privateOfferId value. + */ + public String privateOfferId() { + return this.privateOfferId; + } + + /** + * Set the privateOfferId property: Private Offer Id. + * + * @param privateOfferId the privateOfferId value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withPrivateOfferId(String privateOfferId) { + this.privateOfferId = privateOfferId; + return this; + } + + /** + * Get the planName property: Plan Name. + * + * @return the planName value. + */ + public String planName() { + return this.planName; + } + + /** + * Set the planName property: Plan Name. + * + * @param planName the planName value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withPlanName(String planName) { + this.planName = planName; + return this; + } + + /** + * Get the marketplaceSubscriptionStatus property: Marketplace subscription status. + * + * @return the marketplaceSubscriptionStatus value. + */ + public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { + return this.marketplaceSubscriptionStatus; + } + + /** + * Get the endDate property: End Date of the subscription. + * + * @return the endDate value. + */ + public String endDate() { + return this.endDate; + } + + /** + * Set the endDate property: End Date of the subscription. + * + * @param endDate the endDate value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withEndDate(String endDate) { + this.endDate = endDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (planId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property planId in model MarketplaceDetails")); + } + if (offerId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property offerId in model MarketplaceDetails")); + } + if (planName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property planName in model MarketplaceDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MarketplaceDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("offerId", this.offerId); + jsonWriter.writeStringField("planName", this.planName); + jsonWriter.writeStringField("marketplaceSubscriptionId", this.marketplaceSubscriptionId); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("privateOfferId", this.privateOfferId); + jsonWriter.writeStringField("endDate", this.endDate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MarketplaceDetails. + */ + public static MarketplaceDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceDetails deserializedMarketplaceDetails = new MarketplaceDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("planId".equals(fieldName)) { + deserializedMarketplaceDetails.planId = reader.getString(); + } else if ("offerId".equals(fieldName)) { + deserializedMarketplaceDetails.offerId = reader.getString(); + } else if ("planName".equals(fieldName)) { + deserializedMarketplaceDetails.planName = reader.getString(); + } else if ("marketplaceSubscriptionId".equals(fieldName)) { + deserializedMarketplaceDetails.marketplaceSubscriptionId = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedMarketplaceDetails.publisherId = reader.getString(); + } else if ("privateOfferId".equals(fieldName)) { + deserializedMarketplaceDetails.privateOfferId = reader.getString(); + } else if ("marketplaceSubscriptionStatus".equals(fieldName)) { + deserializedMarketplaceDetails.marketplaceSubscriptionStatus + = MarketplaceSubscriptionStatus.fromString(reader.getString()); + } else if ("endDate".equals(fieldName)) { + deserializedMarketplaceDetails.endDate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceDetails; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/MarketplaceSubscriptionStatus.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/MarketplaceSubscriptionStatus.java new file mode 100644 index 000000000000..aacc1534f5de --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/MarketplaceSubscriptionStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Marketplace subscription status of the file system resource. + */ +public final class MarketplaceSubscriptionStatus extends ExpandableStringEnum { + /** + * Fulfillment has not started. + */ + public static final MarketplaceSubscriptionStatus PENDING_FULFILLMENT_START = fromString("PendingFulfillmentStart"); + + /** + * Marketplace offer is subscribed. + */ + public static final MarketplaceSubscriptionStatus SUBSCRIBED = fromString("Subscribed"); + + /** + * Marketplace offer is suspended because of non payment. + */ + public static final MarketplaceSubscriptionStatus SUSPENDED = fromString("Suspended"); + + /** + * Marketplace offer is unsubscribed. + */ + public static final MarketplaceSubscriptionStatus UNSUBSCRIBED = fromString("Unsubscribed"); + + /** + * Creates a new instance of MarketplaceSubscriptionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MarketplaceSubscriptionStatus() { + } + + /** + * Creates or finds a MarketplaceSubscriptionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MarketplaceSubscriptionStatus. + */ + public static MarketplaceSubscriptionStatus fromString(String name) { + return fromString(name, MarketplaceSubscriptionStatus.class); + } + + /** + * Gets known MarketplaceSubscriptionStatus values. + * + * @return known MarketplaceSubscriptionStatus values. + */ + public static Collection values() { + return values(MarketplaceSubscriptionStatus.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Operation.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Operation.java new file mode 100644 index 000000000000..0d7d30700eb3 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.resourcemanager.dell.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.dell.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/OperationDisplay.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/OperationDisplay.java new file mode 100644 index 000000000000..bb72433b5ae8 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for and operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Operations.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Operations.java new file mode 100644 index 000000000000..10900dee8234 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Origin.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Origin.java new file mode 100644 index 000000000000..9ada4500af45 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ProvisioningState.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ProvisioningState.java new file mode 100644 index 000000000000..7ab062f5b736 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ProvisioningState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning State of the File system resource. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * File system resource creation request accepted. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * File system resource creation started. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * File system resource is being updated. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * File system resource deletion started. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * File system resource creation successful. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * File system resource creation failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * File system resource creation canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * File system resource is deleted. + */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** + * File system resource state is unknown. + */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ResourceEncryptionType.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ResourceEncryptionType.java new file mode 100644 index 000000000000..57b338a66cb3 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/ResourceEncryptionType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Identity type of ManagedIdentity Associated with Dell FileSystem resource. + */ +public final class ResourceEncryptionType extends ExpandableStringEnum { + /** + * Microsoft Managed key. + */ + public static final ResourceEncryptionType ENCRYPTION_AT_REST_WITH_MICROSOFT_KEY + = fromString("ENCRYPTION_AT_REST_WITH_MICROSOFT_KEY"); + + /** + * Customer Managed key. + */ + public static final ResourceEncryptionType ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY + = fromString("ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY"); + + /** + * Creates a new instance of ResourceEncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceEncryptionType() { + } + + /** + * Creates or finds a ResourceEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceEncryptionType. + */ + public static ResourceEncryptionType fromString(String name) { + return fromString(name, ResourceEncryptionType.class); + } + + /** + * Gets known ResourceEncryptionType values. + * + * @return known ResourceEncryptionType values. + */ + public static Collection values() { + return values(ResourceEncryptionType.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/UserAssignedIdentity.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..ed009b6fa9d7 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/UserAssignedIdentity.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/UserDetails.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/UserDetails.java new file mode 100644 index 000000000000..01995e0b26c7 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/UserDetails.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * User Details of Dell FileSystem resource. + */ +@Fluent +public final class UserDetails implements JsonSerializable { + /* + * User Email + */ + private String email; + + /** + * Creates an instance of UserDetails class. + */ + public UserDetails() { + } + + /** + * Get the email property: User Email. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: User Email. + * + * @param email the email value to set. + * @return the UserDetails object itself. + */ + public UserDetails withEmail(String email) { + this.email = email; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (email() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property email in model UserDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("email", this.email); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserDetails. + */ + public static UserDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDetails deserializedUserDetails = new UserDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("email".equals(fieldName)) { + deserializedUserDetails.email = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserDetails; + }); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/package-info.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/package-info.java new file mode 100644 index 000000000000..ee136fcc4ab7 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for Dell. + * Dell Storage service. + */ +package com.azure.resourcemanager.dell.models; diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/package-info.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/package-info.java new file mode 100644 index 000000000000..49cbbe8406ca --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/com/azure/resourcemanager/dell/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for Dell. + * Dell Storage service. + */ +package com.azure.resourcemanager.dell; diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/java/module-info.java b/sdk/dell/azure-resourcemanager-dell/src/main/java/module-info.java new file mode 100644 index 000000000000..8c95a4b395b6 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.dell { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.dell; + exports com.azure.resourcemanager.dell.fluent; + exports com.azure.resourcemanager.dell.fluent.models; + exports com.azure.resourcemanager.dell.models; + + opens com.azure.resourcemanager.dell.fluent.models to com.azure.core; + opens com.azure.resourcemanager.dell.models to com.azure.core; + opens com.azure.resourcemanager.dell.implementation.models to com.azure.core; +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dell/proxy-config.json b/sdk/dell/azure-resourcemanager-dell/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dell/proxy-config.json new file mode 100644 index 000000000000..b5e23f72710e --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dell/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.dell.implementation.FileSystemsClientImpl$FileSystemsService"],["com.azure.resourcemanager.dell.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dell/reflect-config.json b/sdk/dell/azure-resourcemanager-dell/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dell/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dell/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/dell/azure-resourcemanager-dell/src/main/resources/azure-resourcemanager-dell.properties b/sdk/dell/azure-resourcemanager-dell/src/main/resources/azure-resourcemanager-dell.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/main/resources/azure-resourcemanager-dell.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsCreateOrUpdateSamples.java b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f23115a20089 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsCreateOrUpdateSamples.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.resourcemanager.dell.models.EncryptionIdentityProperties; +import com.azure.resourcemanager.dell.models.EncryptionIdentityType; +import com.azure.resourcemanager.dell.models.EncryptionProperties; +import com.azure.resourcemanager.dell.models.FileSystemResourceProperties; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentity; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dell.models.MarketplaceDetails; +import com.azure.resourcemanager.dell.models.ResourceEncryptionType; +import com.azure.resourcemanager.dell.models.UserAssignedIdentity; +import com.azure.resourcemanager.dell.models.UserDetails; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileSystems CreateOrUpdate. + */ +public final class FileSystemsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_CreateOrUpdate_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems() + .define("abcd") + .withRegion("cvbmsqftppe") + .withExistingResourceGroup("rgDell") + .withTags(mapOf("key7594", "fakeTokenPlaceholder")) + .withProperties(new FileSystemResourceProperties() + .withMarketplace(new MarketplaceDetails().withMarketplaceSubscriptionId("mvjcxwndudbylynme") + .withPlanId("eekvwfndjoxijeasksnt") + .withOfferId("bcganbkmvznyqfnvhjuag") + .withPublisherId("trdzykoeskmcwpo") + .withPrivateOfferId("privateOfferId") + .withPlanName("planeName")) + .withDelegatedSubnetId("rqkpvczbtqcxiaivtbuixblb") + .withDelegatedSubnetCidr("10.0.0.1/24") + .withUser(new UserDetails().withEmail("jwogfgznmjabdbcjcljjlkxdpc")) + .withSmartConnectFqdn("fqdn") + .withDellReferenceNumber("fhewkj") + .withEncryption(new EncryptionProperties() + .withEncryptionType(ResourceEncryptionType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withKeyUrl("fakeTokenPlaceholder") + .withEncryptionIdentityProperties(new EncryptionIdentityProperties() + .withIdentityType(EncryptionIdentityType.USER_ASSIGNED) + .withIdentityResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key7644", new UserAssignedIdentity()))) + .create(); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_CreateOrUpdate_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems() + .define("abcd") + .withRegion("tbcvhxzpgrijtdygkttnfswwtacs") + .withExistingResourceGroup("rgDell") + .withProperties(new FileSystemResourceProperties() + .withMarketplace(new MarketplaceDetails().withPlanId("lgozf") + .withOfferId("pzhjvibxqgeqkndqnjlduwnxqbr") + .withPrivateOfferId("privateOfferId") + .withPlanName("planeName")) + .withDelegatedSubnetId("yp") + .withDelegatedSubnetCidr("10.0.0.1/24") + .withUser(new UserDetails().withEmail("hoznewwtzmyjzctzosfuh")) + .withDellReferenceNumber("fhewkj") + .withEncryption(new EncryptionProperties() + .withEncryptionType(ResourceEncryptionType.ENCRYPTION_AT_REST_WITH_MICROSOFT_KEY))) + .create(); + } + + // Use "Map.of" if available + @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/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsDeleteSamples.java b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsDeleteSamples.java new file mode 100644 index 000000000000..b0b990457169 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsDeleteSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +/** + * Samples for FileSystems Delete. + */ +public final class FileSystemsDeleteSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_Delete_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsDeleteMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().delete("rgDell", "abcd", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_Delete_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsDeleteMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().delete("rgDell", "abcd", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsGetByResourceGroupSamples.java b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..da90d000a835 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsGetByResourceGroupSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +/** + * Samples for FileSystems GetByResourceGroup. + */ +public final class FileSystemsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_Get_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsGetMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_Get_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsGetMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsListByResourceGroupSamples.java b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsListByResourceGroupSamples.java new file mode 100644 index 000000000000..f22b0d11790f --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsListByResourceGroupSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +/** + * Samples for FileSystems ListByResourceGroup. + */ +public final class FileSystemsListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListByResourceGroupMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().listByResourceGroup("rgDell", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListByResourceGroupMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().listByResourceGroup("rgDell", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsListSamples.java b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsListSamples.java new file mode 100644 index 000000000000..da19e7cdba96 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +/** + * Samples for FileSystems List. + */ +public final class FileSystemsListSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListBySubscriptionMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsListBySubscriptionMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.fileSystems().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsUpdateSamples.java b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsUpdateSamples.java new file mode 100644 index 000000000000..c9ec4961c1ce --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/FileSystemsUpdateSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.resourcemanager.dell.models.Capacity; +import com.azure.resourcemanager.dell.models.EncryptionIdentityType; +import com.azure.resourcemanager.dell.models.EncryptionIdentityUpdateProperties; +import com.azure.resourcemanager.dell.models.EncryptionUpdateProperties; +import com.azure.resourcemanager.dell.models.FileSystemResource; +import com.azure.resourcemanager.dell.models.FileSystemResourceUpdateProperties; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityUpdate; +import com.azure.resourcemanager.dell.models.ResourceEncryptionType; +import com.azure.resourcemanager.dell.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileSystems Update. + */ +public final class FileSystemsUpdateSamples { + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MinimumSet_Gen.json + */ + /** + * Sample code: FileSystems_Update_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsUpdateMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + FileSystemResource resource = manager.fileSystems() + .getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new FileSystemResourceUpdateProperties().withDelegatedSubnetId("uqfvajvyltgmqvdnxhbrfqbpuey") + .withCapacity(new Capacity().withCurrent("5"))) + .apply(); + } + + /* + * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MaximumSet_Gen.json + */ + /** + * Sample code: FileSystems_Update_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void fileSystemsUpdateMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + FileSystemResource resource = manager.fileSystems() + .getByResourceGroupWithResponse("rgDell", "abcd", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key6099", "fakeTokenPlaceholder")) + .withIdentity( + new ManagedServiceIdentityUpdate().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key7645", new UserAssignedIdentity()))) + .withProperties(new FileSystemResourceUpdateProperties().withDelegatedSubnetId("bfpuabdz") + .withCapacity(new Capacity().withCurrent("5")) + .withEncryption(new EncryptionUpdateProperties() + .withEncryptionType(ResourceEncryptionType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY) + .withKeyUrl("fakeTokenPlaceholder") + .withEncryptionIdentityProperties(new EncryptionIdentityUpdateProperties() + .withIdentityType(EncryptionIdentityType.USER_ASSIGNED) + .withIdentityResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}")))) + .apply(); + } + + // Use "Map.of" if available + @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/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/OperationsListSamples.java b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/OperationsListSamples.java new file mode 100644 index 000000000000..aab248eb6ce2 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/samples/java/com/azure/resourcemanager/dell/generated/OperationsListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-03-21-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-03-21-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to DellManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.dell.DellManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/CapacityTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/CapacityTests.java new file mode 100644 index 000000000000..c453d53ebcb0 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/CapacityTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.Capacity; +import org.junit.jupiter.api.Assertions; + +public final class CapacityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Capacity model = BinaryData.fromString( + "{\"min\":\"kpode\",\"max\":\"oginuvamiheognar\",\"incremental\":\"xth\",\"current\":\"tusivyevcciqihn\"}") + .toObject(Capacity.class); + Assertions.assertEquals("kpode", model.min()); + Assertions.assertEquals("oginuvamiheognar", model.max()); + Assertions.assertEquals("xth", model.incremental()); + Assertions.assertEquals("tusivyevcciqihn", model.current()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Capacity model = new Capacity().withMin("kpode") + .withMax("oginuvamiheognar") + .withIncremental("xth") + .withCurrent("tusivyevcciqihn"); + model = BinaryData.fromObject(model).toObject(Capacity.class); + Assertions.assertEquals("kpode", model.min()); + Assertions.assertEquals("oginuvamiheognar", model.max()); + Assertions.assertEquals("xth", model.incremental()); + Assertions.assertEquals("tusivyevcciqihn", model.current()); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/EncryptionIdentityPropertiesTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/EncryptionIdentityPropertiesTests.java new file mode 100644 index 000000000000..e6b2286e4123 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/EncryptionIdentityPropertiesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.EncryptionIdentityProperties; +import com.azure.resourcemanager.dell.models.EncryptionIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class EncryptionIdentityPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EncryptionIdentityProperties model + = BinaryData.fromString("{\"identityType\":\"UserAssigned\",\"identityResourceId\":\"ocrcjdk\"}") + .toObject(EncryptionIdentityProperties.class); + Assertions.assertEquals(EncryptionIdentityType.USER_ASSIGNED, model.identityType()); + Assertions.assertEquals("ocrcjdk", model.identityResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EncryptionIdentityProperties model + = new EncryptionIdentityProperties().withIdentityType(EncryptionIdentityType.USER_ASSIGNED) + .withIdentityResourceId("ocrcjdk"); + model = BinaryData.fromObject(model).toObject(EncryptionIdentityProperties.class); + Assertions.assertEquals(EncryptionIdentityType.USER_ASSIGNED, model.identityType()); + Assertions.assertEquals("ocrcjdk", model.identityResourceId()); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/EncryptionIdentityUpdatePropertiesTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/EncryptionIdentityUpdatePropertiesTests.java new file mode 100644 index 000000000000..246dcae8ed02 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/EncryptionIdentityUpdatePropertiesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.EncryptionIdentityType; +import com.azure.resourcemanager.dell.models.EncryptionIdentityUpdateProperties; +import org.junit.jupiter.api.Assertions; + +public final class EncryptionIdentityUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EncryptionIdentityUpdateProperties model + = BinaryData.fromString("{\"identityType\":\"SystemAssigned\",\"identityResourceId\":\"bngui\"}") + .toObject(EncryptionIdentityUpdateProperties.class); + Assertions.assertEquals(EncryptionIdentityType.SYSTEM_ASSIGNED, model.identityType()); + Assertions.assertEquals("bngui", model.identityResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EncryptionIdentityUpdateProperties model + = new EncryptionIdentityUpdateProperties().withIdentityType(EncryptionIdentityType.SYSTEM_ASSIGNED) + .withIdentityResourceId("bngui"); + model = BinaryData.fromObject(model).toObject(EncryptionIdentityUpdateProperties.class); + Assertions.assertEquals(EncryptionIdentityType.SYSTEM_ASSIGNED, model.identityType()); + Assertions.assertEquals("bngui", model.identityResourceId()); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/ManagedServiceIdentityTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..40979e76ac5f --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentity; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dell.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"nh\",\"tenantId\":\"njbiksqrglssain\",\"type\":\"None\",\"userAssignedIdentities\":{\"zevndhkrwpdappds\":{\"clientId\":\"zlljfmppeebvm\",\"principalId\":\"sabkyqduujitcjcz\"},\"tmrldhugjzzdatq\":{\"clientId\":\"kvwrwjfeu\",\"principalId\":\"hutje\"},\"huticndvkao\":{\"clientId\":\"oc\",\"principalId\":\"eablg\"},\"kjfkg\":{\"clientId\":\"yiftyhxhuro\",\"principalId\":\"tyxolniwpwc\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities( + mapOf("zevndhkrwpdappds", new UserAssignedIdentity(), "tmrldhugjzzdatq", new UserAssignedIdentity(), + "huticndvkao", new UserAssignedIdentity(), "kjfkg", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); + } + + // Use "Map.of" if available + @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/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/ManagedServiceIdentityUpdateTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/ManagedServiceIdentityUpdateTests.java new file mode 100644 index 000000000000..69555afd4988 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/ManagedServiceIdentityUpdateTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dell.models.ManagedServiceIdentityUpdate; +import com.azure.resourcemanager.dell.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentityUpdate model = BinaryData.fromString( + "{\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"jaoyfhrtx\":{\"clientId\":\"qrolfpf\",\"principalId\":\"algbquxigjyjg\"}}}") + .toObject(ManagedServiceIdentityUpdate.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentityUpdate model + = new ManagedServiceIdentityUpdate().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("jaoyfhrtx", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentityUpdate.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @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/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/MarketplaceDetailsTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/MarketplaceDetailsTests.java new file mode 100644 index 000000000000..b4c1b1dda696 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/MarketplaceDetailsTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.MarketplaceDetails; +import org.junit.jupiter.api.Assertions; + +public final class MarketplaceDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarketplaceDetails model = BinaryData.fromString( + "{\"marketplaceSubscriptionId\":\"ngbwjz\",\"planId\":\"nfygxgispemvtz\",\"offerId\":\"kufubljo\",\"publisherId\":\"qeof\",\"privateOfferId\":\"e\",\"planName\":\"jhqjbasvmsmjqul\",\"marketplaceSubscriptionStatus\":\"Suspended\",\"endDate\":\"tnb\"}") + .toObject(MarketplaceDetails.class); + Assertions.assertEquals("ngbwjz", model.marketplaceSubscriptionId()); + Assertions.assertEquals("nfygxgispemvtz", model.planId()); + Assertions.assertEquals("kufubljo", model.offerId()); + Assertions.assertEquals("qeof", model.publisherId()); + Assertions.assertEquals("e", model.privateOfferId()); + Assertions.assertEquals("jhqjbasvmsmjqul", model.planName()); + Assertions.assertEquals("tnb", model.endDate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarketplaceDetails model = new MarketplaceDetails().withMarketplaceSubscriptionId("ngbwjz") + .withPlanId("nfygxgispemvtz") + .withOfferId("kufubljo") + .withPublisherId("qeof") + .withPrivateOfferId("e") + .withPlanName("jhqjbasvmsmjqul") + .withEndDate("tnb"); + model = BinaryData.fromObject(model).toObject(MarketplaceDetails.class); + Assertions.assertEquals("ngbwjz", model.marketplaceSubscriptionId()); + Assertions.assertEquals("nfygxgispemvtz", model.planId()); + Assertions.assertEquals("kufubljo", model.offerId()); + Assertions.assertEquals("qeof", model.publisherId()); + Assertions.assertEquals("e", model.privateOfferId()); + Assertions.assertEquals("jhqjbasvmsmjqul", model.planName()); + Assertions.assertEquals("tnb", model.endDate()); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationDisplayTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..cd6b75cb6bcc --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationInnerTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationInnerTests.java new file mode 100644 index 000000000000..4903bd4046be --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationListResultTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationListResultTests.java new file mode 100644 index 000000000000..ad7a96ad1fde --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationsListMockTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..80939d396140 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.dell.DellManager; +import com.azure.resourcemanager.dell.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"ohjtckw\",\"isDataAction\":true,\"display\":{\"provider\":\"fiyipjxsqwpgrj\",\"resource\":\"norcjxvsnbyxqab\",\"operation\":\"ocpcy\",\"description\":\"urzafb\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DellManager manager = DellManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/UserAssignedIdentityTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..315fc9618dc4 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/UserAssignedIdentityTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"clientId\":\"w\",\"principalId\":\"lryplwckbasyy\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/UserDetailsTests.java b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/UserDetailsTests.java new file mode 100644 index 000000000000..3f9fa6461927 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/src/test/java/com/azure/resourcemanager/dell/generated/UserDetailsTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.dell.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.dell.models.UserDetails; +import org.junit.jupiter.api.Assertions; + +public final class UserDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserDetails model = BinaryData.fromString("{\"email\":\"bkzgcwrwclx\"}").toObject(UserDetails.class); + Assertions.assertEquals("bkzgcwrwclx", model.email()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserDetails model = new UserDetails().withEmail("bkzgcwrwclx"); + model = BinaryData.fromObject(model).toObject(UserDetails.class); + Assertions.assertEquals("bkzgcwrwclx", model.email()); + } +} diff --git a/sdk/dell/azure-resourcemanager-dell/tsp-location.yaml b/sdk/dell/azure-resourcemanager-dell/tsp-location.yaml new file mode 100644 index 000000000000..2319ae095103 --- /dev/null +++ b/sdk/dell/azure-resourcemanager-dell/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/dell/Dell.Storage.Management +commit: a13809fef80acb580b410532b2eb2dfbaa348dad +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/dell/ci.yml b/sdk/dell/ci.yml new file mode 100644 index 000000000000..773afebe9816 --- /dev/null +++ b/sdk/dell/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/dell/ci.yml + - sdk/dell/azure-resourcemanager-dell/ + exclude: + - sdk/dell/pom.xml + - sdk/dell/azure-resourcemanager-dell/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dell/ci.yml + - sdk/dell/azure-resourcemanager-dell/ + exclude: + - sdk/dell/pom.xml + - sdk/dell/azure-resourcemanager-dell/pom.xml + +parameters: + - name: release_azureresourcemanagerdell + displayName: azure-resourcemanager-dell + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dell + Artifacts: + - name: azure-resourcemanager-dell + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdell + releaseInBatch: ${{ parameters.release_azureresourcemanagerdell }} diff --git a/sdk/dell/pom.xml b/sdk/dell/pom.xml new file mode 100644 index 000000000000..e990500b65d3 --- /dev/null +++ b/sdk/dell/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-dell-service + pom + 1.0.0 + + + azure-resourcemanager-dell + +